Here is the update function (only updating one row at the moment):
void update(int row)
{
DataGridViewCell cell = dataGridView2.CurrentCell as DataGridViewCell;
if (cell.IsInEditMode)
{
string query;
sqlcon.Open();
query = "update tabelaZaposlenih set ime='" + dataGridView2.Rows[row].Cells[1].EditedFormattedValue + "'";
sqlcmd = new SqlCommand(query, sqlcon);
// i added this line afterwards, but no joy...
sqlcmd.Parameters.AddWithValue("ime", dataGridView2.Rows[row].Cells[1].EditedFormattedValue);
sqlcmd.ExecuteNonQuery();
sqlcon.Close();
MessageBox.Show("Podatki uspešno posodobljeni", "Podatki uporabnika");
}
}
What am I doing wrong this time?

New Topic/Question
Reply




MultiQuote





|