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); } } }
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)); }
public SQL Parameter(string name, object value) { mCommand.AddParameter(name, value); return(this); }