0

When i try to log in i keep getting this error and i dont have a clue what it means
the code i used is below along with the error message:

code - Dim dr As OleDbDataReader = cmd.ExecuteReader
error - Syntax error in FROM clause

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by __avd
0

Dear Friend,

U r matching only one time with datareader..
see datareader has one property that "it is read data row wise and one by one"...

so try while loop...
put condition like as follow
:)

While dr.Read = True

some code()

End While
:)


and obviously there is mistake in

:( from clause:( .....

I think this will help u...

0

>error - Syntax error in FROM clause

Please check the syntax of select statement.

...
  Dim cn as New OledbConnection("your connection string")
  Dim cmd as new OledbCommand("select [username] from LoginTable where [username]=@para1 and [password]=@para2",cn)

  cmd.Parameters.AddWithValue("@para1",TextBox1.Text)
  cmd.Parameters.AddWithValue("@para2",TextBox2.Text)
 
   cn.Open()
   Dim dr as OleDBDatareader = cmd.ExecuteReader()
   if dr.Read() Then
           'Login success
   Else
          'Login fails
   End If
   dr.Close()
   cn.Close()
....
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.