// Create a DB factory DbProviderFactory oDataFactory = DbProviderFactories.GetFactory(this._sProviderType); // Get a connection object from the factory DbConnection oConnection = oDataFactory.CreateConnection(); oConnection.ConnectionString = sConnectionString; // Get a command object from the factory DbCommand oCommand = oDataFactory.CreateCommand(); oCommand.CommandText = sQuery; oCommand.Connection = oConnection; // Get a data adapter from the factory DbDataAdapter oDataAdapter = oDataFactory.CreateDataAdapter(); oDataAdapter.SelectCommand = oCommand; // Create the data table and fill it DataTable oDataTable = new DataTable(sCursorName); oDataAdapter.Fill(oDataTable); // Copy the table to the return variable oRetVal = oDataTable;This works really well with no problems. I have then bound the instance of the DataTable
public bool UpdateData(DataTable oDataTable) { // Declare variables bool bRetVal = true; // Create a dataset of changes DataTable oChanges = oDataTable.GetChanges(DataRowState.Modified); // If any rows exist in the changes cursor... if (oChanges.Rows.Count > 0) { // WHAT GOES HERE??? } return bRetVal; }