I am trying this code to add new row to database, the new row is saved but when I close the program down, reopen it, the row has disappeared.
private void Dep_Add_Click(object sender, EventArgs e)
{
try
{
SqlCommandBuilder cb = new SqlCommandBuilder(Dep_da);
DataRow dRow = Dep_ds.Tables["Department"].NewRow();
dRow[1] = Dep_Name.Text;
Dep_ds.Tables["Department"].Rows.Add(dRow);
Dep_MaxRows = Dep_MaxRows + 1;
Dep_inc = Dep_MaxRows - 1;
Dep_da.Update(Dep_ds,"Department");
}
catch (Exception exceptionObject)
{
MessageBox.Show(exceptionObject.Message);
}
So I hope someone can help me