1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
cn.ConnectionString = "Data Source=MEHDI-PC\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=eco"
cmd.Connection = cn
Try
cn.Open()
DataGridView1.Visible = True
da = New SqlDataAdapter(cmd)
cb = New SqlCommandBuilder(da)
da.Fill(ds, "select N_ORD_ECO,SOUS_QUART,CIL,QUART,NOM_CLT,AV_ACC,PORTE,RUE,N_CPT_DEPO,DER_IND_LU,TP_CAL,MAR_DEPO,N_CPT_POS,IND_DEPO,DATE_DEPO,CAL_POS,MAR_POS from COMPTEURS where DATE_POSE='" & DateTimePicker1.Value.Date & "'or N_ORD_ECO='" & ComboBox1.SelectedItem & "' or CIL='" & TextBox1.Text & "' or N_CPT_POS='" & Val(TextBox1.Text) & "' or N_CPT_DEPO='" & Val(TextBox1.Text) & "';")
db = ds.Tables("select N_ORD_ECO,SOUS_QUART,CIL,QUART,NOM_CLT,AV_ACC,PORTE,RUE,N_CPT_DEPO,DER_IND_LU,TP_CAL,MAR_DEPO,N_CPT_POS,IND_DEPO,DATE_DEPO,CAL_POS,MAR_POS from COMPTEURS where DATE_POSE='" & DateTimePicker1.Value.Date & "'or N_ORD_ECO='" & ComboBox1.SelectedItem & "' or CIL='" & TextBox1.Text & "' or N_CPT_POS='" & Val(TextBox1.Text) & "' or N_CPT_DEPO='" & Val(TextBox1.Text) & "';")
DataGridView1.DataSource = db
Catch ex As Exception
MsgBox("Erreur de chargement des données :" & ex.ToString)
End Try
cn.Close() |
Partager