C
coolbee
Unregistered / Unconfirmed
GUEST, unregistred user!
private void Button2_Click(object sender, System.EventArgs e)
{
string myConnString = "Provider=OraOLEDB.Oracle.1;Password=gis;Persist Security Info=True;User ID=tjgis;Data Source=gissvr";
string myUpdate = "UPDATE PRINTLOG SET TOTAL=TOTAL+ @COPIES WHERE REPORTID= @REPORTID";
OleDbConnection myConnection = new OleDbConnection(myConnString);
try
{
myConnection.Open();
OleDbCommand objCommand = new OleDbCommand(myUpdate,myConnection);
try
{
objCommand.Parameters.Add("@COPIES",OleDbType.Integer,10);
objCommand.Parameters.Add("@REPORTID",OleDbType.VarChar,10);
objCommand.Parameters["@COPIES"].Value ="1";
objCommand.Parameters["@REPORTID"].Value = "reportone";
objCommand.ExecuteNonQuery();
}
finally
{
objCommand = null;
}
myConnection.Close();
}
finally
{
myConnection = null;
}
}
下面是错误信息
ORA-00936: 缺少表达式
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: ORA-00936: 缺少表达式
源错误:
行 112: objCommand.Parameters["@COPIES"].Value ="1";
行 113: objCommand.Parameters["@REPORTID"].Value = "reportone";
行 114: objCommand.ExecuteNonQuery();
行 115: }
行 116: finally
{
string myConnString = "Provider=OraOLEDB.Oracle.1;Password=gis;Persist Security Info=True;User ID=tjgis;Data Source=gissvr";
string myUpdate = "UPDATE PRINTLOG SET TOTAL=TOTAL+ @COPIES WHERE REPORTID= @REPORTID";
OleDbConnection myConnection = new OleDbConnection(myConnString);
try
{
myConnection.Open();
OleDbCommand objCommand = new OleDbCommand(myUpdate,myConnection);
try
{
objCommand.Parameters.Add("@COPIES",OleDbType.Integer,10);
objCommand.Parameters.Add("@REPORTID",OleDbType.VarChar,10);
objCommand.Parameters["@COPIES"].Value ="1";
objCommand.Parameters["@REPORTID"].Value = "reportone";
objCommand.ExecuteNonQuery();
}
finally
{
objCommand = null;
}
myConnection.Close();
}
finally
{
myConnection = null;
}
}
下面是错误信息
ORA-00936: 缺少表达式
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: ORA-00936: 缺少表达式
源错误:
行 112: objCommand.Parameters["@COPIES"].Value ="1";
行 113: objCommand.Parameters["@REPORTID"].Value = "reportone";
行 114: objCommand.ExecuteNonQuery();
行 115: }
行 116: finally