|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help Updating Northwind Syntax Win[C#] OLEDBEven though this is a OLE question, hopefully someone can help me. 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. The error I'm getting is The error that it is triggering is "Update unable to find TableMapping['[Order Details]'] or Data Table '[Order Details]'. Order Details is just one table. Is There a way to use a name space name without a hassle? My Code is as follows: Yes & sorry I have posted on another forum, but to no avail. So 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); } } |
|||||||||||||||||||||||