I have a datatable with the following columns:
UserID (pk, autonumber)
UserName (text)
RightsID (number)
I fill a dataset (DSUsers) with the values of this datatable and now I want to find a specific value of this dataset: the RightsID of the first UserID in the table.
I tried the following code:
Dim UserRights as Integer
UserRights = DSUsers.Tables("tblUsers").Rows(0)("RightsID")
But I constantly get the value '0' while it should be '2' because thats the actual value in the database.
I tried your suggestion but I'm still getting the same resultvalue: 0
Here's my code:
SQLUser = "SELECT * FROM tblUsers WHERE UserName=" & user
DAUsers = New OleDbDataAdapter(SQLUser, DataConnectionUsers)
DataConnectionUsers.Open()
DAUsers.Fill(DSUsers, "tblUsers")
DataConnectionUsers.Close()
I tried your suggestion but I still get the same result. I also doublechecked if the dataset contains values and the answer is yes because I filled up a datagrid with the values.