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
| Private Sub fonction_changement_cellule(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Table_famille_nuanceDataGridView.CellEndEdit
Dim recuperation_colonne As String
Dim requete_colonne As String
Dim recuperation_valeur_cellule As String
Dim recuperation_ligne As Integer
Dim mycommand As SqlCommand
Dim ReadSQL As SqlDataReader
btn_save.Enabled = True
recuperation_colonne = ma_table_grid.CurrentCell.ColumnIndex.ToString
recuperation_ligne = ma_table_grid.CurrentRow.Index
recuperation_valeur_cellule = ma_table_grid.CurrentCell.Value.ToString
Select Case recuperation_colonne
Case "10"
Connection_SQL()
requete_colonne = "SELECT [Liste RHO] FROM [dboutillage].[dbo].[Table_liste_RHO] WHERE [C" & recuperation_valeur_cellule & "] like '1'"
mycommand = New SqlCommand(requete_colonne, Maconnexion)
ReadSQL = mycommand.ExecuteReader()
'DataGridViewTextBoxColumn12.DataSource = Nothing
'Table_famille_nuanceDataGridView.Rows(recuperation_ligne).Cells(13).Value = DirectCast(e.Contol, ComboBox).SelectedItem
Do While ReadSQL.Read()
'Table_famille_nuanceDataGridView.Rows(recuperation_ligne).Cells(13).Value = ReadSQL.GetValue(0)
DataGridViewTextBoxColumn12.Items.Add(ReadSQL.GetValue(0))
Loop
ReadSQL.Close()
Deconnection_SQL() |
Partager