J
Jeff
IDE: Visual Studio 2003 .NET
OS: XP pro
I have placed a datagrid on a form, and configured the datagrid to retrieve
data from the database...
I have also created a script that update the table, which the datagrid is
based on... The script update the table, but... If I enter values into a
cell and don't go out of the cell (let's say I don't press the tab-key)
before triggering the update script... the new value isn't saved to the
table... I think this have something to do with rowversion, and the new
value is just a proposed value
I have tried using the DataTable.AcceptChanges(), but it doesn't help..
This is my update script
try
{
SqlCommand cmd;
cmd = new SqlCommand("INSERT INTO BusinessLogic (bl_Code,
bl_Description) VALUES (@bl_Code, @bl_Description)",
qlCon);
cmd.Parameters.Add("@bl_Description", SqlDbType.VarChar, 50,
"bl_Description");
cmd.Parameters.Add("@bl_Code", SqlDbType.VarChar, 20, "bl_Code");
DataTable table = ds.Tables["BusinessLogic"];
table.AcceptChanges();
adapter.InsertCommand = cmd;
adapter.Update(table);
}
catch (SystemException er)
{
MessageBox.Show(er.Message);
}
Any clues to how I can save a proposed value will be appreciated!
Jeff
OS: XP pro
I have placed a datagrid on a form, and configured the datagrid to retrieve
data from the database...
I have also created a script that update the table, which the datagrid is
based on... The script update the table, but... If I enter values into a
cell and don't go out of the cell (let's say I don't press the tab-key)
before triggering the update script... the new value isn't saved to the
table... I think this have something to do with rowversion, and the new
value is just a proposed value
I have tried using the DataTable.AcceptChanges(), but it doesn't help..
This is my update script
try
{
SqlCommand cmd;
cmd = new SqlCommand("INSERT INTO BusinessLogic (bl_Code,
bl_Description) VALUES (@bl_Code, @bl_Description)",
qlCon);
cmd.Parameters.Add("@bl_Description", SqlDbType.VarChar, 50,
"bl_Description");
cmd.Parameters.Add("@bl_Code", SqlDbType.VarChar, 20, "bl_Code");
DataTable table = ds.Tables["BusinessLogic"];
table.AcceptChanges();
adapter.InsertCommand = cmd;
adapter.Update(table);
}
catch (SystemException er)
{
MessageBox.Show(er.Message);
}
Any clues to how I can save a proposed value will be appreciated!
Jeff