日期:2014-05-17  浏览次数:21355 次

access标准表达式中数据类型不匹配
/// <summary>
  /// 修改已有的 line
  /// </summary>
  /// <returns></returns>
  public bool Update_line()
  {
  OleDbConnection con = new OleDbConnection(Comm.ConnectingString);
  OleDbCommand cmd = con.CreateCommand();
  string sql = "update line set name=@name,nvname=@nvname,img=@img,b_id=@b_id,s_id=@s_id,keyword=@keyword,discription=@discription,click_num=@click_num,addtime=@addtime,content=@content,mprice=@mprice,cprice=@cprice,start=@start,num=@num,tiqbm=@tiqbm,wfjiaot=@wfjiaot,lytese=@lytese,pricebaoh=@pricebaoh,pricenbh=@pricenbh,yudtshi=@yudtshi,wxtis=@wxtis,yudxuz=@yudxuz,monily=@monily,lyfangshi=@lyfangshi,lyzhuti=@lyzhuti,zifeixm=@zifeixm,quanzhong=@quanzhong where id=" + this.id;
  cmd.CommandText = sql;
  cmd.Parameters.Add("@name", OleDbType.VarChar, 200).Value = this.name;
  cmd.Parameters.Add("@nvname", OleDbType.VarChar, 200).Value = this.nvname;
  cmd.Parameters.Add("@img", OleDbType.VarChar, 200).Value = this.img;
  cmd.Parameters.Add("@b_id", OleDbType.Integer).Value = this.b_id;
  cmd.Parameters.Add("@s_id", OleDbType.Integer).Value = this.s_id;
  cmd.Parameters.Add("@keyword", OleDbType.VarChar, 500).Value = this.keyword;
  cmd.Parameters.Add("@discription", OleDbType.VarChar, 600).Value = this.discription;
  cmd.Parameters.Add("@click_num", OleDbType.Integer).Value = this.click_num;
  cmd.Parameters.Add("@addtime", OleDbType.Date).Value = this.addtime;
  cmd.Parameters.Add("@content", OleDbType.LongVarChar).Value = this.content;
  cmd.Parameters.Add("@mprice", OleDbType.VarChar, 200).Value = this.mprice;
  cmd.Parameters.Add("@cprice", OleDbType.VarChar, 200).Value = this.cprice;
  cmd.Parameters.Add("@start", OleDbType.LongVarChar).Value = this.start;
  cmd.Parameters.Add("@num", OleDbType.VarChar, 200).Value = this.num;
  cmd.Parameters.Add("@tiqbm", OleDbType.LongVarChar).Value = this.tiqbm;
  cmd.Parameters.Add("@wfjiaot", OleDbType.LongVarChar).Value = this.wfjiaot;
  cmd.Parameters.Add("@lytese", OleDbType.LongVarChar).Value = this.lytese;
  cmd.Parameters.Add("@pricebaoh", OleDbType.LongVarChar).Value = this.pricebaoh;
  cmd.Parameters.Add("@pricenbh", OleDbType.LongVarChar).Value = this.pricenbh;
  cmd.Parameters.Add("@yudtshi", OleDbType.LongVarChar).Value = this.yudtshi;
  cmd.Parameters.Add("@wxtis", OleDbType.LongVarChar).Value = this.wxtis;
  cmd.Parameters.Add("@yudxuz", OleDbType.LongVarChar).Value = this.yudxuz;
  cmd.Parameters.Add("@monily", OleDbType.LongVarChar).Value = this.monily;
  cmd.Parameters.Add("@lyfangshi", OleDbType.Integer).Value = this.lyfangshi;
  cmd.Parameters.Add("@lyzhuti", OleDbType.Integer).Value = this.lyzhuti;
  cmd.Parameters.Add("@quanzhong", OleDbType.Integer).Value = this.quanzhong;
  cmd.Parameters.Add("@zifeixm", OleDbType.LongVarChar).Value = this.zifeixm;
  con.Open();
  try
  {
  if (cmd.ExecuteNonQuery() > 0)
  return true;
  else
  return false;
  }
  catch { return false; }