string sql="insert into message values('"+1199+"')";
string strcon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("message.mdb")+";User Id=admin;Password=;";
OleDbConnection con=new OleDbConnection(strcon);
con.Open();
OleDbCommand mycmd=new OleDbCommand(sql,con);
mycmd.ExecuteNonQuery();
erro:
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.Source Error:
Line 69: con.Open();
Line 70: OleDbCommand mycmd=new OleDbCommand(sql,con);
Line 71: mycmd.ExecuteNonQuery();
Line 72:
Line 73:
string strcon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("message.mdb")+";User Id=admin;Password=;";
OleDbConnection con=new OleDbConnection(strcon);
con.Open();
OleDbCommand mycmd=new OleDbCommand(sql,con);
mycmd.ExecuteNonQuery();
erro:
Operation must use an updateable query.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.Source Error:
Line 69: con.Open();
Line 70: OleDbCommand mycmd=new OleDbCommand(sql,con);
Line 71: mycmd.ExecuteNonQuery();
Line 72:
Line 73:
解决方案 »
- C#获得文件路径和文件名的问题
- DataGridView数据已被修改
- C# 写一个程序 运行后可以生成自己的dll文件.
- C# 页面加载时,动态生成几组textbox并绑定好数据,在修改数据后批量更新到数据库中,如何对应id
- 如何控制DataList中控件的ID
- ASP 程序里的 session 如何传给 ASP.NET
- 有哪們使用新聞組嗎?知道如何保留所有news嗎?每次我更新時,舊的news都不見了.
- p2p连接的问题,对你的挑战有多大?分不够坚决散
- 关于委托和方法以及CallBack、线程的一些问题
- 求教C#调用winAPI问题
- 急 急....生成word时出现"此文件正由另一程序在使用" 请问如何解决???
- 一个简单的问题
如果不是你要修改成:
insert into message(对应字段名) values('"+1199+"')";
string strcon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("message.mdb")+";User Id=admin;Password=;";
OleDbConnection con=new OleDbConnection(strcon);
con.Open();
OleDbCommand mycmd=new OleDbCommand(sql,con);
mycmd.ExecuteNonQuery();
还是出现同样的错误