Shawn, You are very patient, but we're not quite there yet.
> Why don't you make the changes directly to the DataSet instead of > refreshing it from the Database every time? Right, that is my question. Is there a reason it is better to update the dataset rather than refreshing the db? We want to save each update to the DB (so it won't be lost). Is there a reason to go from the pane to the dataset to the DB rather than from the pane to the DB to the dataset? Thanks. -j > -----Original Message----- > From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of > Shawn Wildermuth > Sent: Monday, April 15, 2002 5:49 PM > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] updating dataset and dataform > > > Why don't you make the changes directly to the DataSet instead of > refreshing it from the Database every time? Otherwise, I'd update the > database first, and refresh everything in the order you did when the > page started. > > Thanks, > > Shawn Wildermuth > [EMAIL PROTECTED] > > > -----Original Message----- > > From: dotnet discussion [mailto:[EMAIL PROTECTED]] > > On Behalf Of Bob Edwards > > Sent: Monday, April 15, 2002 5:37 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [DOTNET] updating dataset and dataform > > > > > > Okay, now I'm confused. Here's what I have: > > 1. I load the dataset from the db > > 2. I display the datagrid > > 3. User clicks on a record and I show details in a panel > > based on the record selected 4. User updates the panel and > > clicks a save button 5. I want the datagrid and the panel to > > be updated with the new changes. These have to be written > > back to the db. The dataset also has to be updated; there is > > no direct change made to the dataset based on changes the > > user makes to the panel > > > > Am I missing something? > > > > Thanks. > > > > Bob > > > > > -----Original Message----- > > > From: dotnet discussion > > [mailto:[EMAIL PROTECTED]]On Behalf > > > Of Shawn Wildermuth > > > Sent: Monday, April 15, 2002 5:20 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [DOTNET] updating dataset and dataform > > > > > > > > > No problem. > > > > > > I guess I still don't quite get why you are updating the > > database then > > > requering it. Are you trying to sync up all the updates > > that everyone > > > has done? If not, your DataSet should already be what is in the > > > database. > > > > > > Thanks, > > > > > > Shawn Wildermuth > > > [EMAIL PROTECTED] > > > > > > > -----Original Message----- > > > > From: dotnet discussion [mailto:[EMAIL PROTECTED]] > > > > On Behalf Of Bob Edwards > > > > Sent: Monday, April 15, 2002 5:10 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [DOTNET] updating dataset and dataform > > > > > > > > > > > > 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. > > > > > > > > > > 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. > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.