1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| Imports System.Data.OleDb
Public Class Form1
Dim Cnx As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Kane\Desktop\Cabinet Medical\Cabinet Medical.mdb")
Dim daPat As New OleDbDataAdapter("Select * From Patients", Cnx)
Dim daConsult As New OleDbDataAdapter("Select * From Consultations", Cnx)
Dim daCont As New OleDbDataAdapter("Select * From Contient", Cnx)
Dim daMed As New OleDbDataAdapter("Select * From Medicaments", Cnx)
Dim daCons As New OleDbDataAdapter("Select * From Consultations , Medicaments , Contient Where Medicaments.NumMedicament = Contient.NumMedicament AND Consultations.NumConsult = Contient.NumConsult", Cnx)
Dim dst As New DataSet
Dim dtr As DataRow
Dim dtPat As DataTable
Dim dtConsult As DataTable
Dim dtMed As DataTable
Dim dtcont As DataTable
Dim Db As OleDbCommandBuilder
Dim i As Integer
Dim dtCons As DataTable
Dim numligne As Integer
Dim NumPtnt As Long
Dim DtGridBS As New BindingSource
Sub affichePat()
TextNumPat.Text = dtPat.Rows(numligne).Item(0)
TextNom.Text = dtPat.Rows(numligne).Item(1)
TextPre.Text = dtPat.Rows(numligne).Item(2)
TextSex.Text = dtPat.Rows(numligne).Item(3)
TextDne.Text = dtPat.Rows(numligne).Item(4)
TextProf.Text = dtPat.Rows(numligne).Item(5)
TextAds.Text = dtPat.Rows(numligne).Item(6)
End Sub
Sub vider()
TextNumPat.Clear()
TextNom.Clear()
TextPre.Clear()
TextSex.Clear()
TextDne.Clear()
TextProf.Clear()
TextAds.Clear()
End Sub
Sub afficheCons()
Dim R As String
'daCons = New OleDbDataAdapter("Select * From Consultations , Medicaments , Contient Where Medicaments.NumMedicament = Contient.NumMedicament AND Consultations.NumConsult = Contient.NumConsult AND Consultations.NumPtnt=" & Val(TextNumPat.Text), Cnx)
daCons.Fill(dst, "Consultations")
dtCons = dst.Tables("Consultations")
dtCons.Clear()
daCons.Fill(dst, "Consultations")
dtCons = dst.Tables("Consultations")
affichePat()
DataGridView1.DataSource = dtCons
DtGridBS.DataSource = dtCons
Me.DataGridView1.Columns(8).Visible = False
Me.DataGridView1.Columns(9).Visible = False
DtGridBS.Filter = "NumPtnt = '" & TextNumPat.Text & "'"
End Sub
Sub afficheBD()
DtGridBS.Filter = "NumPtnt = '" & TextNumPat.Text & "'"
End Sub |
Partager