السلام عليكم ورحمة الله وبركاته
هذا كود التسجيل في برنامج:
المشكلة أني لما أعمل تسجيل ، عملية اضافة الشخص في الداتابيس ما تتم
اذا ممكن تصححون لي الكود.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDbConnection
con.ConnectionString = "provider =microsoft.jet.oledb.4.0;data source=c:\CBL\CBLDB.mdb"
Dim f1(10) As String
Dim f2(10) As String
Dim i As Integer = 0
Dim x, y As String
con.Open()
Dim com As OleDbCommand
If RadioButton1.Checked = True Then
Dim s As String = "select * from student"
com = New OleDbCommand(s, con)
Dim r As OleDbDataReader
r = com.ExecuteReader
While r.Read
f1(i) = r.GetValue(1)
f2(i) = r.GetValue(2)
If TextBox1.Text = f1(i) Then
If TextBox2.Text = f2(i) Then
MsgBox("found")
Exit While
End If
Else
i = i + 1
End If
End While
con.Close()
x = TextBox1.Text
y = TextBox2.Text
Dim w As New OleDbCommand
Dim stable As String = "insert into student(S_name,password)values(x,y)"
w.Connection = con
w.CommandText = stable
con.Open()
w.ExecuteNonQuery()
con.Close()
End If
End sub()