/// <summary> /// 输出SQL语句 /// </summary> /// <returns>SQL语句</returns> public override String ToString() { SqlCommandBuilder sb = new SqlCommandBuilder(this.DatabaseType); sb.AppendInsertPrefix().AppendTableName(this._tableName); if (this._parameters.Count > 0) { sb.AppendAllColumnNamesWithParentheses(this._parameters).AppendInsertValues().AppendAllParameterNamesWithParentheses(this._parameters); } return(this.FollowingProcessSql(sb.ToString())); }
/// <summary> /// 获取Sql语句内容 /// </summary> /// <returns>Sql语句内容</returns> public override String GetCommandText() { SqlCommandBuilder sb = new SqlCommandBuilder(this.Database); sb.AppendInsertPrefix().AppendTableName(this._tableName); if (this._insertFields.Count > 0) { sb.AppendAllColumnNamesWithParentheses(this._insertFields).AppendInsertValues().AppendAllParameterNamesWithParentheses(this._insertFields); } return(sb.ToString()); }
/// <summary> /// 获取Sql语句内容 /// </summary> /// <returns>Sql语句内容</returns> public override String GetCommandText() { SqlCommandBuilder sb = new SqlCommandBuilder(this.Database); sb.AppendInsertPrefix().AppendTableName(this._tableName); if (this._parameters.Count > 0) { sb.AppendAllColumnNamesWithParentheses(this._parameters).AppendInsertValues().AppendAllParameterNamesWithParentheses(this._parameters); } return sb.ToString(); }