我一遍又一遍地检查我的代码。但我似乎无法找到此错误发生的位置。这是我的代码:
public static string MerchantUpdate(string firstN, string lastN, int type, int reseller, string CoName, string site, int industry, bool isact, bool isdel, string houseNO, string street, string town, string city, string state, string zipcode, int countryID, string telephone, string fax, string userN, string emailA, string secQ, string secA, decimal set, decimal month, decimal dep, decimal with, decimal eTrans, decimal acct, DateTime created)
{
string retmerUpdate = "";
string merUpdate = "UPDATE MerchantMaster SET FirstName = @fname, LastName = @lname, MerchantTypeID = @typeID, ResellerMasterID = @resellerID, "
+ "CompanyName = @CoName, Url = @url, IndustryID = @IndustryID, IsActive = @isact, IsDeleted = @isdel, HouseNo = hnumber, "
+ "StreetAddress = @address, Town = @townAD, City = @cityAD, State = @stateAD, ZipCode = @zipC, CountryID = @countryID, "
+ "TelephoneNo = @teleNo, FaxNo = @faxNo, UserName = @uName, EmailAdr = @eAD, SecurityQ = @secQ, SecurityA = @secA, Setup = @set, "
+ "Monthly = @month, Deposit = @dep, Withdraw = @with, EmailTransfer = @eTrans, AccTransfer = @acct, DateCreated = @created WHERE id = @id";
string[] param = { "@fname", "@lname", "@typeID", "@resellerID", "@CoName", "@url", "@IndustryID", "@isact", "@isdel", "@hnumber", "@address", "@townAD", "@cityAD", "@stateAD", "@zipC", "@countryID", "@teleNo", "@faxNo", "@uName", "@eAD", "@secQ", "@secA", "@set", "@month", "@dep", "@with", "@eTrans", "@acct", "@created" };
object[] paramVal = { firstN, lastN, type, reseller, CoName, site, industry, isact, isdel, houseNO, street, town, city, state, zipcode, countryID, telephone, fax, userN, emailA, secQ, secA, set, month, dep, with, eTrans, acct, created};
try
{
ClassDBQuery.ExecNonQuery(merUpdate, param, paramVal);
retmerUpdate = "success";
}
catch (Exception ex)
{
retmerUpdate = ex.Message;
}
return retmerUpdate;
}
这是我背后的代码:
using (SqlConnection connectString = new SqlConnection(GetConnectString()))
//update merchant master
try
{
int idses = Convert.ToInt32(Session["ID"].ToString());
string merUpdate = ClassMerchant.MerchantUpdate(fName.Text, lName.Text, Convert.ToInt32(ddlT.SelectedValue), Convert.ToInt32(ddlR.SelectedValue), CompName.Text, website.Text, Convert.ToInt32(ddlI.SelectedValue), true, false, houseN.Text, streetAD.Text, townAD.Text, cityAD.Text, stateAD.Text, zipC.Text, Convert.ToInt32(ddlC.SelectedValue), teleNumb.Text, faxNumb.Text, userN.Text, Eaddress.Text, secQuest.Text, secAns.Text, Convert.ToDecimal(set.Text), Convert.ToDecimal(month.Text), Convert.ToDecimal(dep.Text), Convert.ToDecimal(with.Text), Convert.ToDecimal(etrans.Text), Convert.ToDecimal(aTrans.Text), DateTime.Now);
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
finally
{
if (connectString.State == System.Data.ConnectionState.Open)
connectString.Close();
}
请帮我。