rfazendeiro Posted August 26, 2005 Posted August 26, 2005 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 Quote
Afraits Posted August 26, 2005 Posted August 26, 2005 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. Quote Afraits "The avalanche has started, it is too late for the pebbles to vote"
Joe Mamma Posted August 26, 2005 Posted August 26, 2005 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 allForget 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.) Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
bri189a Posted August 27, 2005 Posted August 27, 2005 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! :) Quote
Joe Mamma Posted August 27, 2005 Posted August 27, 2005 Problem is Joe' date=' 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! :)[/quote'] 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. . . Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
bri189a Posted August 27, 2005 Posted August 27, 2005 Definitely, I was also refering to the ASP datagrid too, so my appologies to any confusion I may of caused anyone out there. Quote
rfazendeiro Posted August 30, 2005 Author Posted August 30, 2005 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.