知行合一

享受过程 漠视结果

导航

Access中参数错误的问题

string sql = "update tb_type set typename=@typename,describe2=@describe2 where id=@id";
           OleDbParameter[] parameters = {
                 
                    new OleDbParameter("@typename", OleDbType.VarChar,50),
                    new OleDbParameter("@describe2", OleDbType.VarChar,50),
                    new OleDbParameter("@id", OleDbType.Integer,4)};
          

         
           parameters[0].Value = model.typename;
           parameters[1].Value = model.describe2;
           parameters[2].Value = model.id;

 

 

在access中居然要求顺序依次对应,今天这个错误做的,哎

posted on 2010-11-04 16:28  项羽  阅读(220)  评论(0编辑  收藏  举报