Column "X" does not belong to the table "table"

vivek_nz76

Member
Joined
Sep 20, 2005
Messages
8
Programming Experience
3-5
Public Function GetUserDetail() As CDbUsers
' Create the Database object, using the default database service. The
' default database service is determined through configuration.
Dim db As Database = DatabaseFactory.CreateDatabase()
Dim sqlCommand As String = "Select * From SecureUser"
Dim dbCommandWrapper As DBCommandWrapper = db.GetSqlStringCommandWrapper(sqlCommand)

Dim userDataSet As DataSet = Nothing
Dim oUser As New CUser
Dim userCol As New CDbUsers
userDataSet = db.ExecuteDataSet(dbCommandWrapper)

For Each row As DataRow In userDataSet.Tables(0).Rows
oUser.UserID = row.Item("UserID")
oUser.FName = row.Item("FirstName")
oUser.LName = row.Item("LastName")
oUser.Username = row.Item("Username")
oUser.Password = row.Item("Password")

userCol.Add(oUser)
Next

Return userCol

End Function

Keeps giving me an error that Column "UserID" does not belong to the table "Table"

Please help. Why is it so?
 
Back
Top