Question : Access TableAdapter and TableAdapter Query for one DataGridView?

I had a DataGridView that I used to display the fields from a single Access table. This worked great as I could easily update it with MyStuffDataset.DataRow = MyStuffDataSet.MyTable.NewRow(); and then call the DataSet.Table.AddRows method to insert rows.

Over time I added a few more tables and added a few joins. i.e. I made a new table for BookDesc and BookId. Now the main table has only BookId and I want the DataGridview to show BookDesc.  

So I wrote a Query in Access and bound to that instead. This works well for displaying the data I want in the DataGridView, but the Query form of the TableAdapter that I am now using does not support the Rows.Add method as it is only a query.  

How do I handle this? There must be a simple method.

Thank You.

Answer : Access TableAdapter and TableAdapter Query for one DataGridView?

I think its because the SqlCommandBuilder cannot create insert/update commands if there is a join in the SQL.

This would mean, after adding the join to your Adapter, you would have lost the InsertCommand and UpdateCommand and therefore the ability to add/change your data.

http://msdn.microsoft.com/en-us/library/tf579hcz(VS.71).aspx

I don't know of any SIMPLE way around it.

Random Solutions  
 
programming4us programming4us