예제 #1
0
 internal void Parse(Command cmd)
 {
     if (SqlText.Length > 0)
     {
         cmd.Text.Append(" where ").Append(SqlText.ToString());
         for(int i =0;i<Parameters.Count;i++)
         {
             Command.Parameter p= Parameters[i];
        
             cmd.AddParameter(p);
         }
     }
 }
예제 #2
0
        public int Execute(IConnectinContext cc)
        {
            Command mCommand = Command.GetThreadCommand().AddSqlText("Update ").AddSqlText(mTable).AddSqlText(" set ");

            for (int i = 0; i < mFields.Count; i++)
            {
                if (i > 0)
                {
                    mCommand.Text.Append(",");
                }
                if (!mFields[i].IsParameter)
                {
                    mCommand.Text.Append(mFields[i].Name).Append("=").Append(mFields[i].Value);
                }
                else
                {
                    mCommand.Text.Append(mFields[i].Name).Append("=@").Append(mFields[i].ParameterName);
                    mCommand.AddParameter(mFields[i].ParameterName, mFields[i].Value);
                }
            }
            Where.Parse(mCommand);
            return(cc.ExecuteNonQuery(mCommand));
        }
예제 #3
0
 public SQL Parameter(string name, object value)
 {
     mCommand.AddParameter(name, value);
     return(this);
 }