我正在尝试使用以下代码将 winforms 输入保存到 firebird 数据库
string connString = ConfigurationManager.AppSettings["ConnectionString"];
FbConnection fbConn = new FbConnection(connString);
fbConn.Open();
FbTransaction tran = fbConn.BeginTransaction();
try
{
string insertCmdStr = "INSERT INTO ARTICLES(ID,Group,Code,Name) ";
insertCmdStr += "VALUES(@id,@group,@code,@name)";
FbCommand addDataCmd = new FbCommand(insertCmdStr, fbConn, tran);
addDataCmd.ExecuteNonQuery();
}
catch (FbException ex)
{
tran.Rollback();
fbConn.Close();
throw new Exception(ex.Message);
}
tran.Commit();
fbConn.Close();
超过一分钟(?)后,我收到以下错误:
必须声明命令参数