UpdateDataSet() public static method

Updates the given table with data from the given DataSet
public static UpdateDataSet ( string connectionString, string commandText, DataSet ds, string tablename ) : void
connectionString string Settings to use for the update
commandText string Command text to use for the update
ds DataSet containing the new data to use in the update
tablename string Tablename in the dataset to update
return void
Exemplo n.º 1
0
 public static Task UpdateDataSetAsync(string connectionString, string commandText, DataSet ds, string tablename)
 {
     return(Task.Factory.StartNew(delegate
     {
         MySqlHelper.UpdateDataSet(connectionString, commandText, ds, tablename);
     }));
 }
Exemplo n.º 2
0
        public static Task UpdateDataSetAsync(string connectionString, string commandText, DataSet ds, string tablename, CancellationToken cancellationToken)
        {
            TaskCompletionSource <bool> taskCompletionSource = new TaskCompletionSource <bool>();

            if (cancellationToken == CancellationToken.None || !cancellationToken.IsCancellationRequested)
            {
                try
                {
                    MySqlHelper.UpdateDataSet(connectionString, commandText, ds, tablename);
                    taskCompletionSource.SetResult(true);
                    goto IL_40;
                }
                catch (Exception exception)
                {
                    taskCompletionSource.SetException(exception);
                    goto IL_40;
                }
            }
            taskCompletionSource.SetCanceled();
IL_40:
            return(taskCompletionSource.Task);
        }