03-04-17, 03:11 PM
If Not IsNumeric(TextBox1.Text) Then
MsgBox("ارجو ادخال رقم التسجيل")
Exit Sub
End If
sql = "select ( n,n1,n2,......Nn)or (*) from Table Name where The primary key field=" & TextBox1.Text
DataAdapter.SelectCommand = New SqlCommand(sql, connection)
DataSet.Clear()
DataAdapter.Fill(DataSet, " Table Name")
If (DataSet.Tables(" Table Name").Rows.Count = 0) Then
MsgBox("الكتاب غير موجود")
Exit Sub
End If
''''''''''''''''''
DataSet.Clear()
DataGridView1.DataSource = DataSet
DataGridView1.DataMember = " Table Name"
MsgBox("ارجو ادخال رقم التسجيل")
Exit Sub
End If
sql = "select ( n,n1,n2,......Nn)or (*) from Table Name where The primary key field=" & TextBox1.Text
DataAdapter.SelectCommand = New SqlCommand(sql, connection)
DataSet.Clear()
DataAdapter.Fill(DataSet, " Table Name")
If (DataSet.Tables(" Table Name").Rows.Count = 0) Then
MsgBox("الكتاب غير موجود")
Exit Sub
End If
''''''''''''''''''
DataSet.Clear()
DataGridView1.DataSource = DataSet
DataGridView1.DataMember = " Table Name"
