尝试更新记录不知道为什么我收到错误 异常详细信息:System.Data.OleDb.OleDbException:没有为一个或多个必需参数提供值。
这是我的代码,请指导我。
public static string lasttable;
public static string newtable;
newtable = "c" + cont.ToString();
lasttable = input;
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\AGENTJ.AGENTJ-PC\Documents\Visual Studio 2010\WebSites\mfaridalam\App_Data\mfaridalam1.accdb; Persist Security Info=False;";
OleDbConnection conn = new OleDbConnection(connectionString);
conn.Open();
string query = "UPDATE [LastInfo] SET [LastAlbum]=@newtable WHERE [LastAlbum]=@lasttable";
OleDbCommand comd = new OleDbCommand();
comd.Parameters.Add("@LastAlbum", OleDbType.VarChar);
comd.Parameters["@LastAlbum"].Value = newtable;
comd.CommandText = query;
comd.Connection = conn;
comd.ExecuteNonQuery();
conn.Close();