コード例 #1
0
 public async Task <int> CreateAndRunInsertAsync(object[] values, string table, string fields)
 {
     return(await OdbcCommands.CreateInsert(await ConnectAsync(), table, SqlUtility.ToArrayFromCommas(fields), values).ExecuteNonQueryAsync());
 }
コード例 #2
0
        public static OdbcCommand CreateInsert(OdbcConnection connection, string table, string[] fields, params object[] args)
        {
            OdbcCommand comm = new OdbcCommand(string.Format(Insert, table, SqlUtility.AppendWithCommas(fields), SqlUtility.GenerateInsertParameters(fields)));

            for (int i = 0; i < args.Length; i++)
            {
                comm.Parameters.Add(new OdbcParameter()
                {
                    Value = args[i]
                });
            }
            comm.Connection = connection;
            return(comm);
        }
コード例 #3
0
 public async Task <int> UpdateAsync(string Table, string Fields, string Where, params object[] Values)
 {
     return(await CreateAndRunUpdateAsync(Table, Where, SqlUtility.ToArrayFromCommas(Fields), Values));
 }