going through datagrid

rfazendeiro

Centurion
Joined
Mar 8, 2004
Messages
110
I have a datagrid where some of the columns are editable and where the user has to insert some data like the price, his status etc.

After he has entered all the information i want to go to all rows and inset that information in the database. But how to i do that?? is the information in the datagrid reflected back in the dataset? i'm a little lost and would appreciate some help


thk to all
 
Yes the datagrid should populate changes back to the dataset if its a bound control and you haven't set the grid to read only. Then its just a matter of calling dataadapter.update to move changes back to the DB. But if you are in a multiuser environment do some research on concurrancy first to avoid problems when multiple users change the same thing.
 
rfazendeiro said:
I have a datagrid where some of the columns are editable and where the user has to insert some data like the price, his status etc.

After he has entered all the information i want to go to all rows and inset that information in the database. But how to i do that?? is the information in the datagrid reflected back in the dataset? i'm a little lost and would appreciate some help


thk to all
Forget everything you were told about using grids in the xtremevbtalk forums. . . it was wrong. Terribly wrong!!!! Even for VBsux.

Remember, in general, your controls are not be used to contain data. They present data, hence the term "presentation.' Controls format, generate events and automatically load data into and out of the underlying data structures (datasets for example) to which they are bound. The underlying data structure should know how to 'talk' to the datastore (such as via a dataadapter.)
 
Problem is Joe, that while we know that, this new version of VS is going to encourage more of that kind of thinking with it's 'new' datagrid that let's you put the SQL in as a property...of coarse you and I will continue use the n tier level approach and the 'object' data source and having a true 'presentation layer', but we're going to see more of this thought encourage by that control. I wish they would take out that feature...can you imagine people putting SQL in html view - I mean for proof of concepts, okay, but anything other than throw away code forget it! Well, at least we won't have to worry about job security! :)
 
bri189a said:
Problem is Joe, that while we know that, this new version of VS is going to encourage more of that kind of thinking with it's 'new' datagrid that let's you put the SQL in as a property...of coarse you and I will continue use the n tier level approach and the 'object' data source and having a true 'presentation layer', but we're going to see more of this thought encourage by that control. I wish they would take out that feature...can you imagine people putting SQL in html view - I mean for proof of concepts, okay, but anything other than throw away code forget it! Well, at least we won't have to worry about job security! :)
I dont know because I am not using 2.0 yet. . .but I am willing to wager that the sql creates a dataset behind the scenes. . .
 
Definitely, I was also refering to the ASP datagrid too, so my appologies to any confusion I may of caused anyone out there.
 
So...i have a question.

i have this structure in my database:

Licence
Modules
Submodules.

So a licence has N modules and a modules belongs to N Licences. So i have a relationship table that is called licenceModules.

A module has N submodules but a sub module mas only 1 module.

To construct a grid something like this

Licence module sub modules
Y A F
Y A G
Y B S
X A F
X A G
X B S
Z A F
Z A G
Z B S


i'm wasting lots of time because i load up the data and then i reconstruct the information into a dataset with this format to then bind it to the datagrid.

I cannot make only 1 sql because there onther thing to take in consideration. Is the some better way to do this?
 
Back
Top