各位大侠,请问一下,我用下面的代码向ACCESS一张表中插入数据,当时到数据库里看是都插入进去了的。但是过一段时间以后,再去查,插入的数据全部自动被回滚了~~~请问各位有没有遇到类似问题,是不是语句上写的有错误,麻烦看看,谢谢~
private string constring = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=admin;User ID=Admin;Data Source=" + Application.StartupPath + "\\db\\IRNdb.mdb";       //insert Dept info
        private bool SaveDpt(string deptname)
        {
            try
            {
                string sqls = "insert into DepT (deptname) values ('"+deptname.ToString()+"')";
                OleDbConnection connection = new OleDbConnection(constring);
                connection.Open();
                OleDbCommand ocmd = new OleDbCommand(sqls, connection);
                ocmd.ExecuteNonQuery();
                connection.Close();
                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
                return false;
            }        }