文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C# ACCESS 参数化SQL语句出错汇总

C# ACCESS 参数化SQL语句出错汇总

时间:2011-04-18  来源:hen

参数顺序错了,就会出错
不过是insert 还是 update
internal static int InsertProducts(TProducts products)
        {
            string sql = "insert into [products] ([name],[price],[pricing],[content],[time],[picture]) values (@name,@price,@pricing,@content,@time,@picture)";
            OleDbParameter[] parameters = new OleDbParameter[]
            {
                AccessHelper.Parameter("@name",products.StrName),
                AccessHelper.Parameter("@price",products.DecPrice,OleDbType.Numeric),
                AccessHelper.Parameter("@pricing",products.DecPricing,OleDbType.Numeric),
                AccessHelper.Parameter("@content",products.StrContent),
                AccessHelper.Parameter("@time",DateTime.Now,OleDbType.Date),
                AccessHelper.Parameter("@picture",products.StrPicture)
            };
            int intTemp = AccessHelper.ExecuteNonQuery(sql, parameters);
            SetSum();
            return intTemp;
        }
      AccessHelper.Parameter("@name",products.StrName),
                AccessHelper.Parameter("@price",products.DecPrice,OleDbType.Numeric),
                AccessHelper.Parameter("@pricing",products.DecPricing,OleDbType.Numeric),
                AccessHelper.Parameter("@content",products.StrContent),
                AccessHelper.Parameter("@time",DateTime.Now,OleDbType.Date),
                AccessHelper.Parameter("@picture",products.StrPicture)
参数顺序错了,就会出错
不过是insert 还是 update
相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载