I can't use DataGridRow due to the protection level. I did try this though, which works for a single selected row (now to iterate this through all the selected rows???): int delRow = (int)dataGrid.CurrentCell.Value; _connStr = this.getDBConnection("net"); SqlConnection conn = new SqlConnection(_connStr); string sql = "delete from gisLinkedDocument where LinkKey in (@delRow)"; SqlCommand cmd = new SqlCommand(sql, conn); SqlParameter parm = cmd.Parameters.Add("@delRow", SqlDbType.Int); parm.Value = delRow; try { conn.Open(); cmd.ExecuteNonQuery(); } catch { MessageBox.Show("The link was NOT deleted"); } finally { if (conn.State != ConnectionState.Closed) conn.Close(); }
look out, noob wreck'n havoc