khomar
شنبه 29 فروردین 1388, 08:46 صبح
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cmd As New OleDb.OleDbCommand
Dim con As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter(cmd)
Dim str As String
str = "Select * from login Where User='" + TextBox2.Text + "', pasword'" + TextBox1.Text + ") '???? ???? ??? "
'??? ???? User ?? ???? ????? ???? ???? SQL ?? ???? ?? ??? ?? ???? ???? ??????? ?? ?? ?? ???? ????? ???? ????.
If DataSet11.Tables("login").Rows.Count <> 1 Then
'If DataSet11.Tables("login").Rows(0).Item(1).ToString = Trim(TextBox1.Text) Then
If DataSet11.Tables("login").Rows(0).Item(1).ToString <> Trim(TextBox1.Text) Then
Me.Hide()
MainForm.Show()
Else
MessageBox.Show("Wrong PassWord")
End If
Else
MessageBox.Show("Wrong Username and password")
End If
سلام
من می خوام مقدارهایی که در تکس باکس ها هست با دو تا از فیلد ها در جدول به نام یوزر و ÷سوورد مقایسه کنم اما از if دوم ایراد می گیره"there is no row position 1 " ممنون می شم اگه کسی بهم بگه ایراد از کجاست.
Dim cmd As New OleDb.OleDbCommand
Dim con As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter(cmd)
Dim str As String
str = "Select * from login Where User='" + TextBox2.Text + "', pasword'" + TextBox1.Text + ") '???? ???? ??? "
'??? ???? User ?? ???? ????? ???? ???? SQL ?? ???? ?? ??? ?? ???? ???? ??????? ?? ?? ?? ???? ????? ???? ????.
If DataSet11.Tables("login").Rows.Count <> 1 Then
'If DataSet11.Tables("login").Rows(0).Item(1).ToString = Trim(TextBox1.Text) Then
If DataSet11.Tables("login").Rows(0).Item(1).ToString <> Trim(TextBox1.Text) Then
Me.Hide()
MainForm.Show()
Else
MessageBox.Show("Wrong PassWord")
End If
Else
MessageBox.Show("Wrong Username and password")
End If
سلام
من می خوام مقدارهایی که در تکس باکس ها هست با دو تا از فیلد ها در جدول به نام یوزر و ÷سوورد مقایسه کنم اما از if دوم ایراد می گیره"there is no row position 1 " ممنون می شم اگه کسی بهم بگه ایراد از کجاست.