23-09-19, 01:55 PM
وهذا الإستعلام من 3 جداول :
كود :
If T1.Text = "" Then
MsgBox("الرجاء ادخال البيانات كاملة ")
T1.Focus()
Else
Try
Using da As New OleDbDataAdapter("Select Top 1 AllName.Name1, AllName.ID1, AllName.Age, AllName.HomeHdress,
Dorat.NameDorh, Dorat.Modh, Dorat.DateEnd,
Ejaza.NameEjaza, Ejaza.DateStart, Ejaza.DateEnd
FROM(Ejaza INNER JOIN Dorat On Ejaza.ID1 = Dorat.ID1)
INNER Join AllName On Dorat.ID1 = AllName.ID1
WHERE(((AllName.ID1) = '" & T1.Text & "'))
GROUP BY AllName.ID1, AllName.Name1, AllName.Age, AllName.HomeHdress,
Dorat.NameDorh, Dorat.Modh, Dorat.DateEnd, Ejaza.NameEjaza,
Ejaza.DateStart, Ejaza.DateEnd ORDER BY Dorat.DateEnd DESC , Ejaza.DateEnd DESC", con)
Dim dt As New DataTable
da.Fill(dt)
If dt.Rows.Count > 0 Then
Name1.Text = dt.Rows(0)(0)
ID1.Text = dt.Rows(0)(1)
Age.Text = dt.Rows(0)(2)
HomeHdress.Text = dt.Rows(0)(3)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
NameEjaza.Text = dt.Rows(0)(7)
TextBox1.Text = dt.Rows(0)(8)
TextBox2.Text = dt.Rows(0)(9)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
TextBox3.Text = dt.Rows(0)(4)
TextBox4.Text = dt.Rows(0)(5)
TextBox5.Text = dt.Rows(0)(6)
Else
MsgBox("رقم القسم غير موجود")
End If
End Using
Catch exp As Exception
MsgBox(exp.Message)
End Try
End If
يا رحمن الدنيا والآخرة ورحيمهما

