| Author: Jigar Joshi 07 Oct 2008 | Member Level: Gold | Rating: Points: 1 |
which line?
|
| Author: Kamaraj 07 Oct 2008 | Member Level: Silver | Rating:  Points: 2 |
in the line of da.SelectCommand.CommandText = "SELECT * FROM tbllogin WHERE username = '+ TxtUsername.Text.trim +' and pass = '+ txtpassword.Text.Trim +'
|
| Author: sappi 07 Oct 2008 | Member Level: Gold | Rating:  Points: 2 |
"SELECT * FROM tbllogin WHERE username ='"+TxtUsername.Text.trim +"','"+txtpassword.Text.Trim +"'";
|
| Author: Abhi 07 Oct 2008 | Member Level: Bronze | Rating:  Points: 2 |
da.SelectCommand.CommandText = "SELECT * FROM tbllogin WHERE username = '+ TxtUsername.Text.trim +' and pass = '+ txtpassword.Text.Trim +'
|
| Author: Kamaraj 07 Oct 2008 | Member Level: Silver | Rating: Points: 1 |
it is also Shown the Error...
Some Query i am Run in the ISQLW it shown nohting.... but just i call Select * from tbllogin it was shown?
|
| Author: santosh 07 Oct 2008 | Member Level: Bronze | Rating:   Points: 3 |
hi just try this
Dim cs As String = "Data Source=SERVER;initial catalog=master;user id=sa" Dim Con As New SqlConnection(cs) Dim da As New SqlDataAdapter If TxtUsername.Text = String.Empty or txtpassword.Text = String.Empty Then MessageBox.Show("Please enter username and password")
ElseIf da.SelectCommand.CommandText = "SELECT * FROM tbllogin WHERE username = '+ TxtUsername.Text.trim() +' and pass = '+ txtpassword.Text.Trim() +' " Then End If
rock on..................... santosh
|
| Author: Abhi 07 Oct 2008 | Member Level: Diamond | Rating:   Points: 3 |
Dim cs As String = "Data Source=SERVER;initial catalog=master;user id=sa" Dim Con As New SqlConnection(cs) Dim da As New SqlDataAdapter If TxtUsername.Text = "" And txtpassword.Text = "" Then MessageBox.Show("Please enter username and password")
ElseIf TxtUsername.Text = "" Then MessageBox.Show("Please enter username") ElseIf txtpassword.Text = "" Then MessageBox.Show("Please enter Password")
ElseIf da.SelectCommand.CommandText = "SELECT * FROM tbllogin WHERE username = '+ TxtUsername.Text.trim() +' and pass = '+ txtpassword.Text.Trim() +' " Then End If
perhaps you are missing Trim() instead of Trim
Thanks and Regards, Abhay
|