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 57
|
strSql = "SELECT NumBeneficiaire, NomBeneficiaire, PrenomBeneficiaire, " & _
"AdresseBeneficiaire + CAST(CPBeneficiaire AS varchar(5)) + VilleBeneficiaire as ligne_adresse_Bene, " & _
"TelephoneBeneficiaire, Portablebeneficiaire " & _
"From BENEFICIAIRES"
Dim strSql1 As String = "Select NumInt, NomInt, PrenomInt, VilleInt, TelFixeInt, TelPortInt from INTERVENANTE"
'on indique la table
table = "INTERVENANTE"
table1 = "BENEFICIAIRE"
'on vide le dataset
ObjetDataSet.Clear()
'on éxécute la fonction pour se connecter à la base et éxécuter la requête
BD.ExecReq(strSql, table, ObjetDataSet)
BD.ExecReq(strSql1, table1, ObjetDataSet1)
ObjetDataTable.Clear()
ObjetDatatable1.Clear()
'On crèe une datatable à partir du dataset
ObjetDataTable = ObjetDataSet.Tables(table)
ObjetDatatable1 = ObjetDataSet1.Tables(table1)
Dim nbligne As Integer = ObjetDataTable.Rows.Count
Dim nbligne1 As Integer = ObjetDatatable1.Rows.Count
' on lie le bindingsource à l'objet datatable
BSIntervenante.DataSource = ObjetDataTable
BindingSource.DataSource = ObjetDatatable1
'on affecte les données au objets visuel
'on remplie la combobox
CMBnomintmission.DataSource = BSIntervenante
CMBnomintmission.ValueMember = "NumInt"
CMBnomintmission.DisplayMember = "NomInt"
'et on remplie tous les textbox
LBLprenomintmission.DataBindings.Clear()
LBLprenomintmission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BSIntervenante, "PrenomInt", True))
LBLvilleintmission.DataBindings.Clear()
LBLvilleintmission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BSIntervenante, "VilleInt", True))
LBLtelintmission.DataBindings.Clear()
LBLtelintmission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BSIntervenante, "TelFixeInt", True))
LBLPortintmission.DataBindings.Clear()
LBLPortintmission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BSIntervenante, "TelPortInt", True))
'on remplie la combobox
CMBnombenemission.DataSource = BindingSource
CMBnombenemission.ValueMember = "NumBeneficiaire"
CMBnombenemission.DisplayMember = "NomBeneficiaire"
'et on remplie tous les textbox
LBLPrenombenemission.DataBindings.Clear()
LBLPrenombenemission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BindingSource, "PrenomBeneficiaire", True))
LBLadrbenemission.DataBindings.Clear()
LBLadrbenemission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BindingSource, "ligne_adresse_Bene", True))
LBLtelbenemission.DataBindings.Clear()
LBLtelbenemission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BindingSource, "TelephoneBeneficiaire", True))
LBLportbenemission.DataBindings.Clear()
LBLportbenemission.DataBindings.Add(New System.Windows.Forms.Binding("Text", BindingSource, "PortableBeneficiaire", True)) |
Partager