Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
Daniel Turini11-Nov-04 5:37
Daniel Turini11-Nov-04 5:37 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
leppie11-Nov-04 5:43
leppie11-Nov-04 5:43 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
SebbaP11-Nov-04 10:12
SebbaP11-Nov-04 10:12 
GeneralRe: Strange behaviour of StreamReader.Peek() Pin
Stefan Troschuetz11-Nov-04 22:04
Stefan Troschuetz11-Nov-04 22:04 
GeneralClearing DateTimePicker Pin
MagdyYousif11-Nov-04 2:29
MagdyYousif11-Nov-04 2:29 
GeneralRe: Clearing DateTimePicker Pin
Corinna John11-Nov-04 3:09
Corinna John11-Nov-04 3:09 
GeneralDATASETS Pin
Brendan Vogt11-Nov-04 1:29
Brendan Vogt11-Nov-04 1:29 
GeneralRe: DATASETS Pin
Skynyrd11-Nov-04 3:55
Skynyrd11-Nov-04 3:55 
DataRows have a DataRowState property which defines if a datarow is modified, added or deleted. Check ur rowNew.RowState and you will se its System.Data.DataRowState.Added.

When u update the source datatable in ur underlying database, the dataadapter
method adptContacts.Update(dsContacts) will use the adapter's DeleteCommand for the Contact's table to delete any Deleted datarows, the InsertCommand for any Added datarows and the UpdateCommand for any modified rows ur datatable might have.

In ur case, ur DataTable only has one Added row, so the dataadapter will add ur row to the underlying database datatable. It wont delete anything anywhere.

In ur code, I seem to be missing where un initialize the adptContacts DataAdaper. U have to create and assign the SqlCommands to it. An easy way is to create the DataAdapter in the designer, it will create all commands by itself, unless ur querying more than one DataTable through a JOIN.
GeneralRe: DATASETS Pin
Le centriste11-Nov-04 4:12
Le centriste11-Nov-04 4:12 
GeneralBinding Collection to DataGrid Pin
Derec Roofie11-Nov-04 1:24
Derec Roofie11-Nov-04 1:24 
GeneralRe: Binding Collection to DataGrid Pin
Daniel Turini11-Nov-04 2:07
Daniel Turini11-Nov-04 2:07 
GeneralRe: Binding Collection to DataGrid Pin
Derec Roofie11-Nov-04 5:18
Derec Roofie11-Nov-04 5:18 
GeneralRe: Binding Collection to DataGrid Pin
Daniel Turini11-Nov-04 5:26
Daniel Turini11-Nov-04 5:26 
QuestionHow to determin parent class Pin
Derec Roofie11-Nov-04 1:14
Derec Roofie11-Nov-04 1:14 
AnswerRe: How to determin parent class Pin
Daniel Turini11-Nov-04 2:06
Daniel Turini11-Nov-04 2:06 
GeneralC# attribute - hlp Pin
dstefan8210-Nov-04 23:45
dstefan8210-Nov-04 23:45 
GeneralNetwork traffic monitoring Pin
JeffHarrold10-Nov-04 22:32
JeffHarrold10-Nov-04 22:32 
GeneralRe: Network traffic monitoring Pin
leppie11-Nov-04 0:19
leppie11-Nov-04 0:19 
GeneralRe: Network traffic monitoring Pin
JeffHarrold11-Nov-04 0:56
JeffHarrold11-Nov-04 0:56 
GeneralRe: Network traffic monitoring Pin
yoaz11-Nov-04 7:27
yoaz11-Nov-04 7:27 
GeneralRe: Network traffic monitoring Pin
JeffHarrold11-Nov-04 11:41
JeffHarrold11-Nov-04 11:41 
GeneralRe: Network traffic monitoring Pin
yoaz11-Nov-04 22:40
yoaz11-Nov-04 22:40 
Generalobtaining values of documentproperties for printing Pin
jomargon10-Nov-04 22:29
jomargon10-Nov-04 22:29 
GeneralBitmap from MetaFile Pin
3green10-Nov-04 22:03
3green10-Nov-04 22:03 
GeneralC# and Microsoft Access Pin
Newbie_Toy10-Nov-04 19:26
Newbie_Toy10-Nov-04 19:26 

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.