I am using Visual Web developer 2008 with backend as Microsoft Access
I am trying to execute query from the table but not returning the values.
In Student table the fields are UserID(PrimaryKey), UserName, UserPwd.
I executed the query to select these 3 values if the provided values in textbox1 and textbox2 matches and to return in label1,label2,label3.
When i try query alone with UserName and UserPwd it is returning values, but not when i query for all the 3.
Dim strSQL As String = "select UserID,UserName,UserPwd from tbl_createuser where UserName=? and UserPwd=?"
Dim cmd As New OleDbCommand(strSQL, DataConn)
Dim dr As OleDbDataReader
dr = cmd.ExecuteReader
If dr.HasRows Then
Label1.Text = dr("UserName")
Label2.Text = dr("UserPwd")
Label3.Text = dr("UserID")
Catch ex As Exception
After the query is executed it displays error as "No data exists for rows/colums". But i am having the rows.
first step is a sanity check; query directly in the Access db itself, use normal query design, manually putting in the values of the 3 textboxes....and verify that the query that you are attempting to send in from Visual Web actually does result in records when implemented in pure Access alone....
queries are never wrong - they may not be what you expect or want - but they are never wrong.....
in this case you have to sanity check the query stand alone inside Access - if it works then you do have a syntax issue in your visual code - - you may need to go to a visual forum for that kind of assist.....