关于SqlParameter[] 索引超出了数组界限
索引超出了数组界限。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IndexOutOfRangeException: 索引超出了数组界限。
源错误:
行 222: parameters[89].Value = model.Pic;
行 223: parameters[90].Value = model.PContent;
行 224: parameters[91].Value = model.Sort;
行 225: parameters[92].Value = model.CTR;
行 226:
源文件: C:\Auto最新\Auto\Auto.SQLServerDAL\AutoProductService.cs 行: 224
代码:
/// <summary>
/// 增加一条数据
/// </summary>
public static int Add(AutoProduct model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into AutoProduct(");
strSql.Append("[ProductId],[CategorieId],[ModelId],[Title],[Pic],[chekuanming],[zhidaojiage],[chandi],[chicun],[zhouju],[zuidagonglv],[zuidaniuju],[biansuqi],[zuigaochesu],[ranyou],[zongheyouhao],[zhengbeizhiliang],[zuowei],[xinglixiangrongji],[chemen],[qianlunju],[houlunju],[zuixiaolidijianxi],[qianxuangua],[houxuangua],[qianhouzhidongqileixing],[qudongfangshi],[tianchuang],[cheshenyanse],[lvhejinlungu],[paiqiliang],[yasuobi],[qigangxingshi],[fadongjichangjiaxinghao],[jiasushijian],[qianhouluntaiguige],[fengzuxishu],[anquanqinang],[ABS],[zhidonglifenpei],[qianyinlikongzhi],[taiyajiancezhuangzhi],[lingtaiyajixuxingshi],[donglisuisuzhuanxiang],[zhudongzhuanxiangxitong],[fangxiangpan],[zuojiaoxiuxitaban],[fangxiangpantiaojie],[duogongnengfangxiangpan],[dingsuxunhang],[bochefuzhu],[duogongnengxianshiping],[zuoyi],[zuoyitiaojie],[yaobuzhichengtiaojie],[qianpaizuoyidiandongtiaojie],[zuoyijiare],[qianzuozhongyangfushou],[houzuozhongyangfushou],[houpaizuoyianbilifangdao],[yinxiangxitong],[yangshengqigeshu],[GPSdaohangxitong],[duomeitikongzhixitong],[chezaidianhua],[zhongkongtaiyejingping],[houpaiyejingping],[MP3zhichi],[dadeng],[wudeng],[qiandiandongchechuang],[houdiandongchechuang],[fangjiashougongneng],[diandonghoushijing],[houshijingjiare],[houshijingdiandongzhedie],[zheyanglian],[houshijingfangxuanmu],[zheyangbanhuazhuangjing],[ganyingyushua],[kongtiao],[chufengkou],[cheneikongqitiaojie],[chezaibingxiang],[dianzifangdao],[cheneizhongkongsuo],[yaokongyaoshi],[wuyaoshiqidongxitong],[PContent],[Sort],[CTR])");
strSql.Append(" values (");
strSql.Append("@ProductId,@CategorieId,@ModelId,@title,@pic,@chekuanming,@zhidaojiage,@chandi,@chicun,@zhouju,@zuidagonglv,@zuidaniuju,@biansuqi,@zuigaochesu,@ranyou,@zongheyouhao,@zhengbeizhiliang,@zuowei,@xinglixiangrongji,@chemen,@qianlunju,@houlunju,@zuixiaolidijianxi,@qianxuangua,@houxuangua,@qianhouzhidongqileixing,@qudongfangshi,@tianchuang,@cheshenyanse,@lvhejinlungu,@paiqiliang,@yasuobi,@qigangxingshi,@fadongjichangjiaxinghao,@jiasushijian,@qianhouluntaiguige,@fengzuxishu,@anquanqinang,@ABS,@zhidonglifenpei,@qianyinlikongzhi,@taiyajiancezhuangzhi,@lingtaiyajixuxingshi,@donglisuisuzhuanxiang,@zhudongzhuanxiangxitong,@fangxiangpan,@zuojiaoxiuxitaban,@fangxiangpantiaojie,@duogongnengfangxiangpan,@dingsuxunhang,@bochefuzhu,@duogongnengxianshiping,@zuoyi,@zuoyitiaojie,@yaobuzhichengtiaojie,@qianpaizuoyidiandongtiaojie,@zuoyijiare,@qianzuozhongyangfushou,@houzuozhongyangfushou,@houpaizuoyianbilifangdao,@yinxiangxitong,@yangshengqigeshu,@GPSdaohangxitong,@duomeitikongzhixitong,@chezaidianhua,@zhongkongtaiyejingping,@houpaiyejingping,@MP3zhichi,@dadeng,@wudeng,@qiandiandongchechuang,@houdiandongchechuang,@fangjiashougongneng,@diandonghoushijing,@houshijingjiare,@houshijingdiandongzhedie,@zheyanglian,@houshijingfangxuanmu,@zheyangbanhuazhuangjing,@ganyingyushua,@kongtiao,@chufengkou,@cheneikongqitiaojie,@chezaibingxiang,@dianzifangdao,@cheneizhongkongsuo,@yaokongyaoshi,@wuyaoshiqidongxitong,@pContent,@sort,@CTR)");
SqlParameter[] parameters =new SqlParameter[] {
new SqlParameter("@ProductId", SqlDbType.Int,4),
new SqlParameter("@CategorieId", SqlDbType.Int,4),
new SqlParameter("@ModelId", SqlDbType.Int,4),
new SqlParameter("@chekuanming", SqlDbType.NVarChar,50),
new SqlParameter("@zhidaojiage", SqlDbType.Money,8),
new SqlParameter("@chandi", SqlDbType.NChar,10),
new SqlParameter("@chicun", SqlDbType.NVarChar,50),
new SqlParameter("@zhouju", SqlDbType.NVarChar,50),
new SqlParameter("@zuidagonglv", SqlDbType.NVarChar,50),
new SqlParameter("@zuidaniuju", SqlDbType.NVarChar,50),
new SqlParameter("@biansuqi", SqlDbType.NVarChar,50),
new SqlParameter("@zuigaochesu", SqlDbType.NVarChar,50),
new SqlParameter("@ranyou", SqlDbType.NVarChar,50),
new SqlParameter("@zongheyouhao", SqlDbType.NVarChar,50),
new SqlParameter("@zhengbeizhiliang", SqlDbType.NVarChar,50),
new SqlParameter("@zuowei", SqlDbType.NVarChar,50),
new SqlParameter("@xinglixiangrongji", SqlDbType.NVarChar,50),
new SqlParameter("@chemen", SqlDbType.NVarChar,50),
new SqlParameter("@qianlunju", SqlDbType.NVarChar,50),
new SqlParameter("@houlunju", SqlDbType.NVarChar,50),
new SqlParameter("@zuixiaolidijianxi", SqlDbType.NVarChar,50),
new SqlParameter("@qianxuangua", SqlDbType.NVarChar,100),
new SqlParameter("@houxuangua", SqlDbType.NVarChar,100),
new SqlParameter("@qianhouzhidongqileixing", SqlDbType.NVarChar,100),
new SqlParameter("@qudongfangshi", SqlDbType.NVarChar,50),
new SqlParameter("@tianchuang", SqlDbType.NVarChar,50),
new SqlParameter("@cheshenyanse", SqlDbType.NVarChar,50),
new SqlParameter("@lvhejinlungu", SqlDbType.NVarChar,50),
new SqlParameter("@paiqiliang", SqlDbType.NVarChar,50),
new SqlParameter("@yasuobi", SqlDbType.NVarChar,50),
new SqlParameter("@qigangxingshi", SqlDbType.NVarChar,50),
new SqlParameter("@fadongjichangjiaxinghao", SqlDbType.NVarChar,50),
new SqlParameter("@jiasushijian", SqlDbType.NVarChar,50),
new SqlParameter("@qianhouluntaiguige", SqlDbType.NVarChar,50),
new SqlParameter("@fengzuxishu", SqlDbType.NVarChar,50),
new SqlParameter("@anquanqinang", SqlDbType.NVarChar,50),
new SqlParameter("@ABS", SqlDbType.NVarChar,50),
new SqlParameter("@zhidonglifenpei", SqlDbType.NVarChar,50),
new SqlParameter("@qianyinlikongzhi", SqlDbType.NVarChar,50),
new SqlParameter("@taiyajiancezhuangzhi", SqlDbType.NVarChar,50),
new SqlParameter("@lingtaiyajixuxingshi", SqlDbType.NVarChar,50),
new SqlParameter("@donglisuisuzhuanxiang", SqlDbType.NVarChar,50),
new SqlParameter("@zhudongzhuanxiangxitong", SqlDbType.NVarChar,50),
new SqlParameter("@fangxiangpan", SqlDbType.NVarChar,50),
new SqlParameter("@zuojiaoxiuxitaban", SqlDbType.NVarChar,50),
new SqlParameter("@fangxiangpantiaojie", SqlDbType.NVarChar,50),
new SqlParameter("@duogongnengfangxiangpan", SqlDbType.NVarChar,50),
new SqlParameter("@dingsuxunhang", SqlDbType.NVarChar,50),
new SqlParameter("@bochefuzhu", SqlDbType.NVarChar,50),
new SqlParameter("@duogongnengxianshiping", SqlDbType.NVarChar,50),
new SqlParameter("@zuoyi", SqlDbType.NVarChar,50),
new SqlParameter("@zuoyitiaojie", SqlDbType.NVarChar,50),
new SqlParameter("@yaobuzhichengtiaojie", SqlDbType.NVarChar,50),
new SqlParameter("@qianpaizuoyidiandongtiaojie", SqlDbType.NVarChar,50),
new SqlParameter("@zuoyijiare", SqlDbType.NVarChar,50),
new SqlParameter("@qianzuozhongyangfushou", SqlDbType.NVarChar,50),
new SqlParameter("@houzuozhongyangfushou", SqlDbType.NVarChar,50),
new SqlParameter("@houpaizuoyianbilifangdao", SqlDbType.NVarChar,50),
new SqlParameter("@yinxiangxitong", SqlDbType.NVarChar,50),
new SqlParameter("@yangshengqigeshu", SqlDbType.NVarChar,50),
new SqlParameter("@GPSdaohangxitong", SqlDbType.NVarChar,50),
new SqlParameter("@duomeitikongzhixitong", SqlDbType.NVarChar,50),
new SqlParameter("@chezaidianhua", SqlDbType.NVarChar,50),
new SqlParameter("@zhongkongtaiyejingping", SqlDbType.NVarChar,50),
new SqlParameter("@houpaiyejingping", SqlDbType.NVarChar,50),
new SqlParameter("@MP3zhichi", SqlDbType.NVarChar,50),
new SqlParameter("@dadeng", SqlDbType.NVarChar,50),
new SqlParameter("@wudeng", SqlDbType.NVarChar,50),
new SqlParameter("@qiandiandongchechuang", SqlDbType.NVarChar,50),
new SqlParameter("@houdiandongchechuang", SqlDbType.NVarChar,50),
new SqlParameter("@fangjiashougongneng", SqlDbType.NVarChar,50),
new SqlParameter("@diandonghoushijing", SqlDbType.NVarChar,50),
new SqlParameter("@houshijingjiare", SqlDbType.NVarChar,50),
new SqlParameter("@houshijingdiandongzhedie", SqlDbType.NVarChar,50),
new SqlParameter("@zheyanglian", SqlDbType.NVarChar,50),
new SqlParameter("@houshijingfangxuanmu", SqlDbType.NVarChar,50),
new SqlParameter("@zheyangbanhuazhuangjing", SqlDbType.NVarChar,50),
new SqlParameter("@ganyingyushua", SqlDbType.NVarChar,50),
new SqlParameter("@kongtiao", SqlDbType.NVarChar,50),
new SqlParameter("@chufengkou", SqlDbType.NVarChar,50),
new SqlParameter("@cheneikongqitiaojie", SqlDbType.NVarChar,50),
new SqlParameter("@chezaibingxiang", SqlDbType.NVarChar,50),
new SqlParameter("@dianzifangdao", SqlDbType.NVarChar,50),
new SqlParameter("@cheneizhongkongsuo", SqlDbType.NVarChar,50),
new SqlParameter("@yaokongyaoshi", SqlDbType.NVarChar,50),
new SqlParameter("@wuyaoshiqidongxitong", SqlDbType.NVarChar,50),
new SqlParameter("@title",SqlDbType.NVarChar,50),
new SqlParameter("@pic",SqlDbType.NVarChar,50),
new SqlParameter("@pContent",SqlDbType.NText),
new SqlParameter("@sort",SqlDbType.Int,4),
new SqlParameter("@CTR",SqlDbType.Int,4)
};
parameters[0].Value = model.ProductId;
parameters[1].Value = model.CategorieId;
parameters[2].Value = model.ModelId;
parameters[3].Value = model.Chekuanming;
parameters[6].Value = model.Zhidaojiage;
parameters[7].Value = model.Chandi;
parameters[8].Value = model.Chicun;
parameters[9].Value = model.Zhouju;
parameters[10].Value = model.Zuidagonglv;
parameters[11].Value = model.Zuidaniuju;
parameters[12].Value = model.Biansuqi;
parameters[13].Value = model.Zuigaochesu;
parameters[14].Value = model.Ranyou;
parameters[15].Value = model.Zongheyouhao;
parameters[16].Value = model.Zhengbeizhiliang;
parameters[17].Value = model.Zuowei;
parameters[18].Value = model.Xinglixiangrongji;
parameters[19].Value = model.Chemen;
parameters[20].Value = model.Qianlunju;
parameters[21].Value = model.Houlunju;
parameters[22].Value = model.Zuixiaolidijianxi;
parameters[23].Value = model.Qianxuangua;
parameters[24].Value = model.Houxuangua;
parameters[25].Value = model.Qianhouzhidongqileixing;
parameters[26].Value = model.Qudongfangshi;
parameters[27].Value = model.Tianchuang;
parameters[28].Value = model.Cheshenyanse;
parameters[29].Value = model.Lvhejinlungu;
parameters[30].Value = model.Paiqiliang;
parameters[31].Value = model.Yasuobi;
parameters[32].Value = model.Qigangxingshi;
parameters[33].Value = model.Fadongjichangjiaxinghao;
parameters[34].Value = model.Jiasushijian;
parameters[35].Value = model.Qianhouluntaiguige;
parameters[36].Value = model.Fengzuxishu;
parameters[37].Value = model.Anquanqinang;
parameters[38].Value = model.ABS;
parameters[39].Value = model.Zhidonglifenpei;
parameters[40].Value = model.Qianyinlikongzhi;
parameters[41].Value = model.Taiyajiancezhuangzhi;
parameters[42].Value = model.Lingtaiyajixuxingshi;
parameters[43].Value = model.Donglisuisuzhuanxiang;
parameters[44].Value = model.Zhudongzhuanxiangxitong;
parameters[45].Value = model.Fangxiangpan;
parameters[46].Value = model.Zuojiaoxiuxitaban;
parameters[47].Value = model.Fangxiangpantiaojie;
parameters[48].Value = model.Duogongnengfangxiangpan;
parameters[49].Value = model.Dingsuxunhang;
parameters[50].Value = model.Bochefuzhu;
parameters[51].Value = model.Duogongnengxianshiping;
parameters[52].Value = model.Zuoyi;
parameters[53].Value = model.Zuoyitiaojie;
parameters[54].Value = model.Yaobuzhichengtiaojie;
parameters[55].Value = model.Qianpaizuoyidiandongtiaojie;
parameters[56].Value = model.Zuoyijiare;
parameters[57].Value = model.Qianzuozhongyangfushou;
parameters[58].Value = model.Houzuozhongyangfushou;
parameters[59].Value = model.Houpaizuoyianbilifangdao;
parameters[60].Value = model.Yinxiangxitong;
parameters[61].Value = model.Yangshengqigeshu;
parameters[62].Value = model.GPSdaohangxitong;
parameters[63].Value = model.Duomeitikongzhixitong;
parameters[64].Value = model.Chezaidianhua;
parameters[65].Value = model.Zhongkongtaiyejingping;
parameters[66].Value = model.Houpaiyejingping;
parameters[67].Value = model.MP3zhichi;
parameters[68].Value = model.Dadeng;
parameters[69].Value = model.Wudeng;
parameters[70].Value = model.Qiandiandongchechuang;
parameters[71].Value = model.Houdiandongchechuang;
parameters[72].Value = model.Fangjiashougongneng;
parameters[73].Value = model.Diandonghoushijing;
parameters[74].Value = model.Houshijingjiare;
parameters[75].Value = model.Houshijingdiandongzhedie;
parameters[76].Value = model.Zheyanglian;
parameters[77].Value = model.Houshijingfangxuanmu;
parameters[78].Value = model.Zheyangbanhuazhuangjing;
parameters[79].Value = model.Ganyingyushua;
parameters[80].Value = model.Kongtiao;
parameters[81].Value = model.Chufengkou;
parameters[82].Value = model.Cheneikongqitiaojie;
parameters[83].Value = model.Chezaibingxiang;
parameters[84].Value = model.Dianzifangdao;
parameters[85].Value = model.Cheneizhongkongsuo;
parameters[86].Value = model.Yaokongyaoshi;
parameters[87].Value = model.Wuyaoshiqidongxitong;
parameters[88].Value = model.Title;
parameters[89].Value = model.Pic;
parameters[90].Value = model.PContent;
parameters[91].Value = model.Sort;
parameters[92].Value = model.CTR;
return SqlHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), parameters);
}
不知道错在哪里,希望高手帮忙····