开发者

Inserted Record not getting saved in MS-Access Database through C#.NET 2008

开发者 https://www.devze.com 2023-02-20 01:49 出处:网络
HI, I am making a Windows Application in C#. NET. When I insert a record in MS-Access Datab开发者_如何学Pythonase. It shows that the record is saved, No Errors Occur. But When I reload the project, t

HI,

I am making a Windows Application in C#. NET. When I insert a record in MS-Access Datab开发者_如何学Pythonase. It shows that the record is saved, No Errors Occur. But When I reload the project, the record which I added is not found in Database. Please help.

Here is the Code, I am using:

DataSet ds13 = new DataSet(); 
OleDbDataReader dr13;
OleDbCommand cmd13 = new OleDbCommand();
cmd13.CommandType = CommandType.Text; 
cmd13.CommandText = "INSERT INTO Due_Party VALUES(@A,@B,@C,@D,@E,@F,@G)";    
cmd13.Parameters.Add("@A", SqlDbType.Text).Value = textBox11.Text; 
con.ConnectionString = constr; 
cmd13.Connection = con;
con.Open(); 
cmd13.ExecuteNonQuery(); 
con.Close();

Regards Sunil Kumar


How long after the insert are you checking? I only ask because something sticks in my mind about delayed writes when using ADO. But before I go 'a' googling can you let me know

EDIT: Ok it might be the same kind of thing as this

http://support.microsoft.com/kb/200300

I know that is talking about ADO and not ADO.Net but the idea might be the same. Does the record show up if you check again later?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号