Forum Moderators: open
I'm trying to get a single field out of the table.
The row looks something like: ID (int), Role(string)
So I have my AccessDataSource all configured up to point at the DB, which all looks good in the previews etc.
In the code I have tried:
myVariable = 1
AccessDataSource1.SelectCommand = "SELECT [Role] FROM [tbl_standard_roles] WHERE ([ID] = " & myVariable & ")"
myRole = AccessDataSource1.Select(DataSourceSelectArguments.Empty)
no luck, so I tried:
myVariable = 1
AccessDataSource1.SelectCommand = "SELECT [Role] FROM [tbl_standard_roles] WHERE ([ID] = " & myVariable & ")"
Dim dv As Data.DataView = AccessDataSource1.Select(DataSourceSelectArguments.Empty)
myRole = dv.ToTable.Rows(0)(1).ToString again no luck.
The AccessDataSource1.Select just doesn't seem to be returning anything - there's definitely a record with 1 as the ID - so I'm at a complete loss as to how to access data, I'm assuming there is a way getting back a recordset from the AccessDataSource control? or do I need to go back to the old DataSets, etc?