![我的错误信息如何修复此错误,我已经检查了我的数据表,但我找不到此错误
procedureName = "InvoiceDetails";
cmdType = CommandType.StoredProcedure;
parameters.Add(new SqlParameter("@InvoiceNo", SqlDbType.Int));//0
parameters.Add(new SqlParameter("@H", SqlDbType.NVarChar, 50));//1
parameters.Add(new SqlParameter("@value", SqlDbType.Decimal ));//2
parameters.Add(new SqlParameter("@ExchangeRate", SqlDbType.Decimal));//3
parameters.Add(new SqlParameter("@Hamount", SqlDbType.Decimal));//4
parameters.Add(new SqlParameter("@HAWBAmountLKR", SqlDbType.Decimal));//5
parameters.Add(new SqlParameter("@Discountamount ", SqlDbType.Decimal));//6
parameters.Add(new SqlParameter("@DisType", SqlDbType.Int));//7
parameters.Add(new SqlParameter("@CurrencyType", SqlDbType.VarChar,(10)));//8
parameters.Add(new SqlParameter("@InvoiceDatetime",SqlDbType.DateTime));//9
parameters.Add(new SqlParameter("@fuel",SqlDbType.Decimal));//10
parameters.Add(new SqlParameter("@Invoicecode", SqlDbType.NVarChar, 30));//11
parameters.Add(new SqlParameter("@InvoiceTotal", SqlDbType.Decimal));//12
parameters.Add(new SqlParameter("@compCode", SqlDbType.NVarChar, 30));//13
parameters.Add(new SqlParameter("@CreateUserID", SqlDbType.NVarChar, 30));//14
parameters.Add(new SqlParameter("@Status", SqlDbType.Int));//15
//Inserting data through stored procedure
parameters[0].Value = 1;//0
parameters[1].Value = DropDownh.SelectedValue.ToString();//1
parameters[2].Value = Double.Parse(txtvalue.Text.Trim());//2
parameters[3].Value = Double.Parse(txtexchage.Text.Trim());//3
parameters[4].Value = Double.Parse(txtUSD.Text.Trim());//4
parameters[5].Value = Double.Parse(txtLKR.Text.Trim());//5
parameters[6].Value = Double.Parse(txtfuel0.Text.Trim());//6
parameters[7].Value = DropDiz.SelectedValue.ToString();//7
parameters[8].Value = "USD";//8
parameters[9].Value = DateTime.Now;//DateStampLabel.Text.Trim().Replace("'", "''"); //9
parameters[10].Value = "0.00";//10
parameters[11].Value = "N/A";//11
parameters[12].Value = "0.00";//12
parameters[13].Value = LblcompCode.Text.Trim().Replace("'", "''");//13
parameters[14].Value = LbluserName.Text.Trim().Replace("'", "''");//14
parameters[15].Value = 0;//15
] 1
答案 0 :(得分:4)
我怀疑Parameter[7]
它应该是int
试试这样:
Int.Parse(DropDiz.SelectedValue.ToString())