0
初學者級別的程序員在這裏,我一直堅持通過Microsoft Visual Studio查詢我的數據庫(SQL Server)並實際返回我想要的結果的元組的問題。從Microsoft Visual Studio查詢數據庫(SQL Server)
例如..如果我想要一個特定的項目ID的部門,我想查詢它像這樣在一個子程序,並調用子程序
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)
既不工作,如果部門projectID
1被命名爲Zero
- 我如何編程它返回此值?
給我們在你的sql服務器上的表結構,請 – shibormot 2013-03-10 01:01:31