Hi,
I am new to VSTO. I am still not getting any suitable answer for my earlier posts. Let me expalin my actual problem:
I have used following code to bind the ListObject:
DataSet dsTrims = new DataSet();
dsTrims = MyDataAccessLayer.Provider.ExecuteDataSet(System.Data.CommandType.Text, strWhere);
this.bindingdataSource1.DataSource = dsTrims.Tables[0];
myListObject.AutoSetDataBoundColumnHeaders = true;
myListObject.SetDataBinding(bindingdataSource1);
My where string is as follows:
strWhere = "SELECT tablename1.tb1col1 , tablename1.tb1col2 , tablename2.tb2col1 , tablename2.tb2col2 , tablename3.tb3col1, tablename3.tb3col2 FROM tablename2 INNER JOIN tablename1 ON tablename1.tb1col1 = tablename2.tb2col1 INNER JOIN .............ORDER BY ...............";
Now how should I put logic for updating these inner joined tables through listobject. Here I have dataset but not tableadapter. How should I iterate through listobject. Is there any property into listobject that I have to set.
Any other way will be appreciated
Thank you

Is it not possible to update tables with ListObject without dataset (created through wizard)
David Levinson
Hi,
Thanks you both for your reply.
1. Mei Liang Said:
"One way I can think of is to monitor ListObject change event and get the target range that has content changed, then update the data directly using sql commands."
My Post:
"How should I grab target range that has content changed. And suppose user has changed more than 10 ranges/cells, then where should I collect all these changes. In List Collection Can we iterate through ListObjects columns and rows and put these changes to any collection Please provide some code for better understanding."
2. Mike Hernandez Said:
" The "Binding Data to Controls Overview" article from our VSTO On-line Help Documentation in the MSDN Library may help you here. Here is the link to the article: http://msdn2.microsoft.com/en-us/library/ad7sfx3w(VS.80).aspx
There is a section on updating data that may be useful to you. Please review this article"
My Post:
"I went through this article and found the topic for updating data but its not useful and suitable for me because its uses TableAdapter everywhere for updating. In my case as above code shown, I think we cannt use TableAdapter here."
3. Is it possible to update just single table without TableAdapter with ListObject. Suppose in my case I am using just one table instead of 3-4 tables and then my strWhere="Select * from Table1". Is there possibility after that
4. Can we collect all the changes made to cells/range of listbox/excelsheet by iterating through listbox into list collection and then can we force this list collection to update. Can data into list collection automatically mapped to specific tables column name. If possible please provide some example code.
Thank you
Regg
Your questions deal with some of the details of the data binding architecture in Winforms. I would suggest you check up the details of DataSets and how the update can go forward to the actual table at http://msdn2.microsoft.com/en-us/library/system.data.dataset(VS.80).aspx.
Some of the steps in working with DataSets include:
In a typical multiple-tier implementation, the steps for creating and refreshing a DataSet, and in turn, updating the original data are to:
Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter.
Change the data in individual DataTable objects by adding, updating, or deleting DataRow objects.
Invoke the GetChanges method to create a second DataSet that features only the changes to the data.
Call the Update method of the DataAdapter, passing the second DataSet as an argument.
Invoke the Merge method to merge the changes from the second DataSet into the first.
Invoke the AcceptChanges on the DataSet. Alternatively, invoke RejectChanges to cancel the changes.
Its important to note that ListObject allows you to bind to a DataSet, the responsibility of actual update happening accross on the physical database is that of the developer.
As far as collecting the changes from ListObject, you can use the ListObject.Change event and it passes the targetRange which has changed as one of the values. TargetRange.Value2 has the value of all the cells that have changed. (It could be an object, object[], or object[,]).
-Nikhil
ThomasSob
Hi,
Please provide some usefull feedback.
Thank you
Brunosdd
Hey,
One way I can think of is to monitor ListObject change event and get the target range that has content changed, then update the data directly using sql commands.
Hope this helps,
Mei
--------------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
jaabrown
Hi Nikhil,
Its very nice post but not going to help me lot.
Beacuse I have already told that I am unable to use "DataAdapter" here.
Please provide some other solution.
Thank you
hutchbrew
The "Binding Data to Controls Overview" article from our VSTO On-line Help Documentation in the MSDN Library may help you here. Here is the link to the article:
http://msdn2.microsoft.com/en-us/library/ad7sfx3w(VS.80).aspx
There is a section on updating data that may be useful to you. Please review this article, apply your newfound knowledge to your scenario, and let us know if you have any further questions.
Thanks!
Mike Hernandez
Community Program Manager
VSTO Team
Greg Knierim
As I suggested, your question seems to deal with ADO.NET architecture. I would suggest you to check up http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.dotnet.framework.adonet&lang=en&cr=US or http://forums.microsoft.com/msdn/showforum.aspx forumid=45&siteid=1.