M
MikeY
Hi Everyone,
I'm having problems with my syntax on the updating part for the
Northwind.MDB. All other code seems fine. It has to do with the Order
Details on the thisAdapter.Update( ). Or I believe the problem lies with
with space between Order and Details and not knowing how to get around that
problem. I would like to keep with the space being left in-between the two
names. My Code is as follows:
Any and all help is appreciated.
Mike
private void DataUpdate()
{
try
{
OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Northwind.MDB");
thisConnection.Open();
OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * FROM [Order
Details]", thisConnection);
OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "Order Details");
thisDataSet.Tables["Order Details"].Rows[0]["Quantity"] = "99";
thisAdapter.Update(thisDataSet, "[Order Details]");
thisConnection.Close();
}
catch(Exception myExcept)
{
MessageBox.Show(myExcept.Message);
}
}
I'm having problems with my syntax on the updating part for the
Northwind.MDB. All other code seems fine. It has to do with the Order
Details on the thisAdapter.Update( ). Or I believe the problem lies with
with space between Order and Details and not knowing how to get around that
problem. I would like to keep with the space being left in-between the two
names. My Code is as follows:
Any and all help is appreciated.
Mike
private void DataUpdate()
{
try
{
OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Northwind.MDB");
thisConnection.Open();
OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * FROM [Order
Details]", thisConnection);
OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "Order Details");
thisDataSet.Tables["Order Details"].Rows[0]["Quantity"] = "99";
thisAdapter.Update(thisDataSet, "[Order Details]");
thisConnection.Close();
}
catch(Exception myExcept)
{
MessageBox.Show(myExcept.Message);
}
}