0
我得到以下異常:錯誤[HY090] [Informix .NET provider]無效的字符串或緩衝區長度。
"ERROR [HY090] [Informix .NET provider]Invalid string or buffer length."
當我嘗試調用下面的方法:
public static int PrepareSal(int year, int month, int calcYear)
{
using (IfxConnection con = new IfxConnection(ConfigurationManager.ConnectionStrings["testable"].ToString()))
{
int res = 0;
StringBuilder cmdTxt = new StringBuilder();
cmdTxt.Append("hkr_calc");
using (var myIfxCmd = new IfxCommand(cmdTxt.ToString(), con))
{
myIfxCmd.CommandType = CommandType.StoredProcedure;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
myIfxCmd.Parameters.Clear();
myIfxCmd.Parameters.Add("p_year", IfxType.Integer, year);
myIfxCmd.Parameters.Add("p_month", IfxType.Integer, month);
myIfxCmd.Parameters.Add("p_calc_year", IfxType.Integer, calcYear);
// myIfxCmd.CommandTimeout = 15000;
res = myIfxCmd.ExecuteNonQuery(); //exception
}
con.Close();
con.Dispose();
return res;
}
}
當我打電話我在SQL編輯器的程序,它工作正常,但它大約需要10分鐘!