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
|
Try
Dim strCon = CStr("provider=microsoft.jet.oledb.4.0;" & "data source= " & Application.StartupPath & "\" & "Demandes.mdb;")
Cn = New OleDb.OleDbConnection(strCon)
Cn.ConnectionString = strCon
Cn.Open()
CmdR = Cn.CreateCommand() 'Creation de commande
CmdR.CommandText = "select Nom_Tech as [Technicien], DateHeureReparation as [Date réparation], durée as [Durée], DescriptionRep as [Description réparation], HeuresDemandes.id_demande FROM HeuresDemandes INNER JOIN Techniciens ON Techniciens.ID_Tech = HeuresDemandes.ID_Tech where Id_Demande = '" & no & "'"
DtSet = New DataSet
DtAdapteur = New OleDb.OleDbDataAdapter
DtAdapteur.SelectCommand = CmdR
DtAdapteur.Fill(DtSet, "heuresDemandes")
Details_Heures_Problemes.DG_Heures_Probs.DataSource = DtSet.Tables("heuresDemandes")
Details_Heures_Problemes.DG_Heures_Probs.Columns.Item(0).Visible = True
Details_Heures_Problemes.DG_Heures_Probs.Columns.Item(1).Visible = True
Details_Heures_Problemes.DG_Heures_Probs.Columns.Item(2).Visible = True
Details_Heures_Problemes.DG_Heures_Probs.Columns.Item(3).Visible = True
Details_Heures_Problemes.DG_Heures_Probs.Columns.Item(4).Visible = False
Cn = Nothing
CmdR = Nothing
DtAdapteur = Nothing
DtSet = Nothing
DtTable = Nothing
DtRow = Nothing
Catch ex As OleDb.OleDbException
Cn = Nothing
CmdR = Nothing
DtAdapteur = Nothing
DtSet = Nothing
DtTable = Nothing
DtRow = Nothing
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try |
Partager