Click here to Skip to main content
15,915,848 members
Home / Discussions / C#
   

C#

 
GeneralRe: data base Pin
SeMartens15-Dec-04 23:24
SeMartens15-Dec-04 23:24 
GeneralRe: data base Pin
Heath Stewart15-Dec-04 22:47
protectorHeath Stewart15-Dec-04 22:47 
GeneralDisable controls without highliting Pin
fracalifa15-Dec-04 21:21
fracalifa15-Dec-04 21:21 
GeneralRe: Disable controls without highliting Pin
Jay Shankar15-Dec-04 22:16
Jay Shankar15-Dec-04 22:16 
GeneralRe: Disable controls without highliting Pin
fracalifa15-Dec-04 22:48
fracalifa15-Dec-04 22:48 
GeneralRe: Disable controls without highliting Pin
Jay Shankar16-Dec-04 14:17
Jay Shankar16-Dec-04 14:17 
Generalpropagating datagrid changes in multiple tables Pin
Rashid_Mehmood15-Dec-04 20:31
Rashid_Mehmood15-Dec-04 20:31 
GeneralRe: propagating datagrid changes in multiple tables Pin
Heath Stewart15-Dec-04 22:41
protectorHeath Stewart15-Dec-04 22:41 
Read the SDK documentation for the DataAdapter.Update method, which describes in rather nice detail what is required and basically how it works. You use a DataAdapter-derivative - like SqlDataAdapter - with the InsertCommand, DeleteCommand, and UpdateCommand specified (in addition to the SelectCommand, which is both required and assumed since you already have a DataSet. Based on a DataRow's DataRowState, the record will be added, updated, or deleted.

Generally you should specify an INSERT statement followed by a SELECT statement for the InsertCommand. This is because any auto-generated fields defined on the database may be different (and most likely will) than what is in your DataSet. After inserting the row, the select will make sure your DataSet contains the right data.

If you are sending this DataSet across the wire to be updated, first call DataSet.GetChanges to get a DataSet of only the changes. This is only necessary if you send the DataSet across the wire before passing it to DataAdapter (like in a typical 3-tier design). Do not call DataSet.AcceptChanges, however, otherwise all the change-tracking information is lost. DataAdapter.Update will do this upon successful completion of the update.

Read http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatacommondataadapterclassupdatetopic.asp[^] for more information.

You can also click "Search comments" above and search for "DataAdapter", for example, for previous discussions about this. We have talked about it quite a bit in this forum over the years.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
QuestionHow to disconnect remoting server properly? Pin
kosjanne15-Dec-04 20:28
kosjanne15-Dec-04 20:28 
AnswerRe: How to disconnect remoting server properly? Pin
Heath Stewart15-Dec-04 22:35
protectorHeath Stewart15-Dec-04 22:35 
GeneralRe: How to disconnect remoting server properly? Pin
kosjanne15-Dec-04 23:04
kosjanne15-Dec-04 23:04 
GeneralRe: How to disconnect remoting server properly? Pin
Heath Stewart15-Dec-04 23:12
protectorHeath Stewart15-Dec-04 23:12 
QuestionUserControl designer bug ? Pin
Gangren15-Dec-04 19:30
Gangren15-Dec-04 19:30 
AnswerRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 19:55
Jay Shankar15-Dec-04 19:55 
GeneralRe: UserControl designer bug ? Pin
Gangren15-Dec-04 20:10
Gangren15-Dec-04 20:10 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 20:24
Jay Shankar15-Dec-04 20:24 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar15-Dec-04 20:41
Jay Shankar15-Dec-04 20:41 
GeneralRe: UserControl designer bug ? Pin
Gangren15-Dec-04 20:50
Gangren15-Dec-04 20:50 
AnswerRe: UserControl designer bug ? Pin
Gangren16-Dec-04 1:31
Gangren16-Dec-04 1:31 
GeneralRe: UserControl designer bug ? Pin
Jay Shankar16-Dec-04 14:13
Jay Shankar16-Dec-04 14:13 
GeneralRecording wave file in low level Pin
vhunghl15-Dec-04 19:28
vhunghl15-Dec-04 19:28 
GeneralRe: Recording wave file in low level Pin
Daniel Turini15-Dec-04 22:50
Daniel Turini15-Dec-04 22:50 
GeneralRemoving whitespace Pin
kobezt0815-Dec-04 19:18
kobezt0815-Dec-04 19:18 
GeneralRe: Removing whitespace Pin
Gangren15-Dec-04 19:39
Gangren15-Dec-04 19:39 
GeneralRe: Removing whitespace Pin
kobezt0815-Dec-04 19:42
kobezt0815-Dec-04 19:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.