hi every body
i have a strange problem i build a project in ms access and c# i was working fine no problem once i work on it i discover a strange thing all data is lost on data in the table
i try to add data from my form again to follow and find what happen i find that it works fine and save data when i close the project and open access database through visual or access i find its lost again i add data from access and close it and open it again i find data is still there when i open the project from visual it get lost the most strange that happen for only one table not all tables the form which use this table code is
private void btnsave_Click(object sender, EventArgs e)
{
try
{
_con = new OleDbConnection(_cs);
_con.Open();
string newVariable =
string.Format(@"SELECT top 1 Tbl_UserDetails.Installment_Number FROM Tbl_Users INNER JOIN Tbl_UserDetails ON Tbl_Users.USer_ID = Tbl_UserDetails.USer_ID WHERE Tbl_Users.Name='{0}' ORDER BY Tbl_UserDetails.Installment_date DESC", txtname.Text);
_cmd = new OleDbCommand(newVariable, _con);_ds = new DataSet();
_da = new OleDbDataAdapter(_cmd);_da.Fill(_ds, "Tbl_InstallmentCount");
if (_ds.Tables[0].Rows.Count != 0)
{_installNumber = Convert.ToInt32(_ds.Tables[0].Rows[0]["Installment_Number"]);
}
if (_installNumber == 0)
{
_installNumber = 1;
}else
{
_installNumber += 1;
}
string cb =
string.Format(@"insert into Tbl_UserDetails( USer_ID, Installment_Number, Installment_previous_Rest,Installment_Change,Installment_Total, Installment_date) VALUES ({0},{1},{2},{3},{4},{5})",
_x, _installNumber, txttotal.Text, txtpay.Text, txtsumtotal.Text, string.Format("#{0}#", dateTimePicker1.Value.ToShortDateString()));
_cmd = new OleDbCommand(cb) {Connection = _con};
_cmd.ExecuteReader();
_con.Close();
XtraMessageBox.Show(@"added", "add", MessageBoxButtons.OK,
MessageBoxIcon.Information);
Clear();
if (_installNumber != 0)
{_installNumber = 0;
}
gridControl1.DataSource = null;
}
catch (Exception ex)
{
XtraMessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
where is the problem (My code - office - windows or what ??)