1 Try2 { 3Dbutility.commandinfo dbcom =Newdbutility.commandinfo ();4List<dbutility.commandinfo> strstranlist =NewList<dbutility.commandinfo>(); 5 6StringBuilder strSQL =NewStringBuilder ();7Strsql.append ("Update jia72_members Set");8Strsql.append ("[email protected],");9Strsql.append ("[email protected],");TenStrsql.append ("[email protected],"); OneStrsql.append ("[email protected],"); AStrsql.append ("[email protected],"); -Strsql.append ("[email protected],"); -Strsql.append ("[email protected],"); theStrsql.append ("[email protected]"); -Strsql.append ("Where [email protected]"); - stringSTRSQLM =strsql.tostring (); - +sqlparameter[] Parameters = { - NewSqlParameter ("@Id", SqlDbType.Int,4), + NewSqlParameter ("@UserName", SqlDbType.NVarChar, -), A NewSqlParameter ("@YTCardId", SqlDbType.Int,4), at NewSqlParameter ("@CardNum", SqlDbType.NVarChar, -), - NewSqlParameter ("@Bank", SqlDbType.NVarChar, -), - NewSqlParameter ("@BankNumber", SqlDbType.NVarChar, +), - NewSqlParameter ("@QQNumber", SqlDbType.NVarChar, -), - NewSqlParameter ("@RealName", SqlDbType.NVarChar,Ten), - NewSqlParameter ("@SavedOn", Sqldbtype.datetime) in }; -parameters[0]. Value =model. Id; toparameters[1]. Value =model. UserName; +parameters[2]. Value =model. Ytcardid; -parameters[3]. Value =model. Cardnum; theparameters[4]. Value =model. Bank; *parameters[5]. Value =model. Banknumber; $parameters[6]. Value =model. Qqnumber;Panax Notoginsengparameters[7]. Value =model. Realname; -parameters[8]. Value =model. Savedon; the +Dbcom.commandtext =strsql.tostring (); ADbcom. Parameters =parameters; theStrstranlist.add (dbcom);//Binding member Information + - //Update card Table $ strsql.clear (); $Strsql.append ("Update Jia72_ytcard Set"); -Strsql.append ("isbind=1,"); -Strsql.append ("savedon=getdate ()"); theStrsql.append ("where id="+model. Ytcardid); - WuyiDbcom.commandtext =strsql.tostring (); theDbcom. Parameters =NULL; -Strstranlist.add (dbcom);//Update card table bindings Wu - if(DBUtility.DbHelperSQL.ExecuteSqlTran (Strstranlist) >0) About { $DotNet.Common.MessageBox.ShowAndRedirect ( This,"Save success! ","usermanages.aspx"); - } - Else - { AMessageBox.Show ( This,"The operation failed, please contact the administrator!"); + } the } - Catch(Exception ex) $ { theLoghelper.writewebexloginfo ( This, ex); theMessageBox.Show ( This,"The operation failed, please contact the administrator!"); the return; the}
Description: Reference dbutility with commandinfo organization Parameters! Still need to use SqlHelper, sad urge!
Dbhelpersql Business!