I have spent *far* too much of our company's precious time trying to
figure out how to get ADO.NET to do one simple update of a FoxPro
database file. I have no trouble accessing FoxPro files and making
the data viewable and changing the in-memory contents [AcceptChanges()
works fine]. But I have been completely unable to get the changes
back out to the underlying database file. Any help would be *most*
I have the ODBC.NET provider up and working and can populate a DataSet
with multiple DataTable objects and can display and modify them in a
DataGrid just fine.
I am not able, however, to update the actual FoxPro .DBF file no
matter what I try.
I keep DataAdapters for each DataTable in a Hastable(m_AdapterDict).
Here is a fragment of C# code where I am trying to update one of the
public void UpdateDataSet(string inTableName)
OdbcDataAdapter myAdapter =
OdbcConnection cn = m_DConnection;
string mySQL = "select * from " + inTableName;
myAdapter.SelectCommand = new OdbcCommand(mySQL, cn);
OdbcCommandBuilder custCB =
catch (Exception ex)
m_dtSet is the DataSet maintained as a static in the helper class thatQuote:}
contains this code fragment. It is successfully accessed by other
I have tried with and without an OdbcCommandBuilder with no joy. BTW,
the OdbcCommandBuilder does not seem to build an updateCommand in its
What am I doing wrong and what approaches will actually work? Help!