Beginner level programmer here and I've been stuck with this issue of querying my database (SQL Server) through Microsoft Visual Studio and actually returning the tuple of the result I want.
For instance.. If I want the sector of a particular Project ID, I'd query it like this in a subroutine, and call the subroutine
Public Sub testing()
projectID = 1
Dim sqlQueryObject = (From a In db.Project1 Where a.ProjectID = projectID
Select a.Sector) 'Using LINQ
'Now have the object (works fine)
'The Issue is getting the actual sector value from this query...in which I've tried a couple of things
End Sub
dim somestring as string = Cstr(sqlQueryObject)
dim somestring as string = Ctype(sqlqueryobject, string)
Neither work, If the sector for projectID
1 is named Zero
- How do I program it to return this value?