我有一個SQL代碼如下:的OracleParameter到的Int32問題
public void UpdateDatabase(String strParam1, int row)
{
System.Data.OracleClient.OracleConnection conn = new System.Data.OracleClient.OracleConnection();
conn.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.144)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)));UID=mwm;PWD=mwm";
conn.Open();
OracleCommand command = conn.CreateCommand();
command.CommandText = "Select id from Task";
OracleParameter taskId = new OracleParameter();
taskId.DbType = DbType.Int32;
taskId.Value = taskId;
taskId.ParameterName = "taskId";
command.Parameters.Add(taskId);
command.ExecuteNonQuery();
command.Dispose();
}
}
當達到的ExecuteNonQuery時,我得到「無法參數值從的OracleParameter到的Int32轉換」這裏有什麼問題的錯誤?我Google搜索,但無法得出結論。