I'm coming from working with just ms access to try to learn to do the same things in sql. I'm getting an error that says:
incorrect error at syntax '?'
The command string that I'm using is:
and that's how I would do it with the OleDbCommand. Could somebody shed some light for me?
Also the way I created the SQL database was:
Quote:
incorrect error at syntax '?'
Code:
Dim cmd As New SqlCommand("SELECT username,password FROM login WHERE username = ? AND password = ?", con)
cmd.Parameters.AddWithValue("username", UsernameTextBox.Text)
cmd.Parameters.AddWithValue("password", PasswordTextBox.Text)
Also the way I created the SQL database was:
- Add New DataSource
- Database -> Next
- Dataset -> Next
- New Connection
- Change DataSource -> MS SQL Database File -> Ok
- Name database -> OK