Closed Thread Icon

Topic awaiting preservation: .NET, a datagrid & a roundhouse trip to a database I could do without Pages that link to <a href="https://ozoneasylum.com/backlink?for=25281" title="Pages that link to Topic awaiting preservation: .NET, a datagrid &amp;amp; a roundhouse trip to a database I could do without" rel="nofollow" >Topic awaiting preservation: .NET, a datagrid &amp; a roundhouse trip to a database I could do without\

 
Author Thread
paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 03-17-2005 07:48

Hi guys,

I have an editable datagrid which loads values from a sqlserver database and also allows to edit & delete the respective elements when needed. I have currently also included a seperate add utility in the form of textboxes and an add button which enters all textbox values into the databse and binds the datagrid showing the newly entered row. The thing is this all doing very well BUT the problem is that these additions and updations all require a round trip to the database updating and deleting entries directly from the databse.

I want that the datagrid allows editing and edition of values in the datagrid but doesn't upodate the database until I say so, like I could put a 'save all' button that updates the changed values in the datagrid to the database in ONE go.

Any solutions , source code snippets would be greatly appreciated

Blacknight
Bipolar (III) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 03-17-2005 14:34

if you are using datasets and dataadapter you can load all the datta in to the dataadapter edit the data and with the datadadapter.update save all the edited data to the db


fill the dataset wit info from the dataadapter

Me.OleDbDataAdapter1.Fill(Me.DataSet11)

now do your databindings to the dataset1

update the edited data

Me.OleDbDataAdapter1.Update(Me.DataSet11)


that should do the trick

paritycheck
Bipolar (III) Inmate

From: you tell me
Insane since: Mar 2004

posted posted 03-21-2005 08:01

GUess what I found out that I can use a datatable as a temporary store and bind the datagrid to it and then when I'm done manipulating the datatable all I need to do is use the adapter to update the db - as blacknight pointed out.

Thanx for the help

« BackwardsOnwards »

Show Forum Drop Down Menu