Torna al Thread

void dGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex != dGrid.Columns["Edita"].Index) return; Edita_Dati ed = new Edita_Dati(); ed.ID = Convert.ToInt32(dGrid[0, e.RowIndex].Value); ed.ShowDialog(); if (e.RowIndex < 0 || e.ColumnIndex != dGrid.Columns["X"].Index) { } else { using (SQLiteConnection conn = new SQLiteConnection(db.Apri_db().ToString())) { string sql = "DELETE from Main Where ID=" + Convert.ToInt32(dGrid[0, e.RowIndex].Value) + ";"; conn.Open(); SQLiteCommand cmd = new SQLiteCommand(sql, conn); cmd.ExecuteNonQuery(); } } }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5