Shawn, First, thank you for taking so much time to answer my questions. Next, and I don't mean to challenge your answer at all, but I'm trying to understand it, can you say why #2 is better? I have code that updates the db through a stored procedure. I then can requery for the dataset and then assign the dataview to the datagrid.
Would it be cleaner or more efficient to update the dataset, and then have the dataset update the database? I'm willing, I'd like to get it right, but I want to understand why one is better than the other. Thanks again Bob. > -----Original Message----- > From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of > Shawn Wildermuth > Sent: Monday, April 15, 2002 4:47 PM > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] updating dataset and dataform > > > Hmmm.... > > I think #2 makes more sense. If were my system, I would wrap the fact > that you are updating multiple tables from a single row in a stored > procedure. In that way, creating the DataAdapter's Command objects will > be trivial (ok, Stored Procs are never trivial). That way you can > update the database from the DataSet and you should never have to rebind > to the DataGrid. Am I still missing the point? > > Thanks, > > Shawn Wildermuth > [EMAIL PROTECTED] > > > -----Original Message----- > > From: dotnet discussion [mailto:[EMAIL PROTECTED]] > > On Behalf Of Bob Edwards > > Sent: Monday, April 15, 2002 4:12 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [DOTNET] updating dataset and dataform > > > > > > Thanks for the feedback but my question must not have been clear. > > > > I can update in one of two ways: > > > > 1. Update the database and then refill the dataset and then > > rebind to the datagrid or, 2. Update the dataset, rebind the > > datagrid and from the dataset update the db > > > > The datastructure is somewhat complex (two tables in the > > dataset and each table draws from multiple tables in the db) > > and every edit should be written back to the db. Do you > > recommend 1 or 2? > > > > Thanks. > > > > > -----Original Message----- > > > From: dotnet discussion > > [mailto:[EMAIL PROTECTED]]On Behalf > > > Of Shawn > > Wildermuth > > > Sent: Monday, April 15, 2002 3:56 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [DOTNET] updating dataset and dataform > > > > > > > > > The DataAdapter usually only updates a single Table at a > > time. If you > > > send a DataSet to the Update (as in > > dataAdapter.Update(dataSet)), it > > > will attempt to update a table called "Table". Probably > > not what you > > > want. > > > > > > > > > > > > > You can read messages from the DOTNET archive, unsubscribe > > from DOTNET, or subscribe to other DevelopMentor lists at > > http://discuss.develop.com. > > > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.