Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: Bounds Checker in C# / .NET Pin
Kant8-Jul-03 16:40
Kant8-Jul-03 16:40 
GeneralRe: Bounds Checker in C# / .NET Pin
Daniel Turini9-Jul-03 4:14
Daniel Turini9-Jul-03 4:14 
GeneralRe: Bounds Checker in C# / .NET Pin
James T. Johnson9-Jul-03 6:14
James T. Johnson9-Jul-03 6:14 
Generalclosing an open form Pin
.gonad8-Jul-03 4:08
.gonad8-Jul-03 4:08 
GeneralRe: closing an open form Pin
zuhx8-Jul-03 10:29
zuhx8-Jul-03 10:29 
GeneralRe: closing an open form Pin
.gonad8-Jul-03 15:46
.gonad8-Jul-03 15:46 
GeneralUpdating a data table Pin
totig8-Jul-03 1:03
totig8-Jul-03 1:03 
GeneralRe: Updating a data table Pin
Rocky Moore8-Jul-03 1:13
Rocky Moore8-Jul-03 1:13 
Your code is actually, Adding a row to the table not updating one. Since you are "adding" a row with the same ID as one that already exists and thus the error.

If the row you want to modify is in the table already, all you have to do is:

categoryDataTable.Rows[test2]["catCategoryName"]=catTextBox1.Text;
categoryDataAdapter.Update(categoryDataTable);

Depending on how the DataAdapter is configured it will autmatically accept the changes when it updates.

The other problem is that you called AcceptChanges prior to an update on the DataAdapter. That would tell your dataset/table that the changes have been accepted and to clear the flag saying their are added or modified. That is the flag that the DataAdpater uses to update your data on the server by.

Rocky Moore <><
GeneralRe: Updating a data table Pin
totig8-Jul-03 1:26
totig8-Jul-03 1:26 
GeneralRe: Updating a data table Pin
totig8-Jul-03 1:58
totig8-Jul-03 1:58 
GeneralRe: Updating a data table Pin
Rocky Moore8-Jul-03 4:51
Rocky Moore8-Jul-03 4:51 
GeneralRe: Updating a data table Pin
STW10-Jul-03 20:49
STW10-Jul-03 20:49 
Generalssh &amp; C# Pin
Karavaev Denis7-Jul-03 23:23
Karavaev Denis7-Jul-03 23:23 
GeneralRe: ssh &amp; C# Pin
Daniel Turini8-Jul-03 2:05
Daniel Turini8-Jul-03 2:05 
Generaldatagrid Pin
Cristian_Dior7-Jul-03 21:29
Cristian_Dior7-Jul-03 21:29 
Questionhow do I change the views using the same frame windows Pin
mdolby7-Jul-03 14:34
mdolby7-Jul-03 14:34 
AnswerRe: how do I change the views using the same frame windows Pin
leppie7-Jul-03 14:42
leppie7-Jul-03 14:42 
GeneralArrays and Threads Pin
albean7-Jul-03 14:05
albean7-Jul-03 14:05 
GeneralRe: Arrays and Threads Pin
leppie7-Jul-03 14:22
leppie7-Jul-03 14:22 
GeneralRe: Arrays and Threads Pin
J. Dunlap7-Jul-03 14:34
J. Dunlap7-Jul-03 14:34 
GeneralRe: Arrays and Threads Pin
leppie7-Jul-03 14:35
leppie7-Jul-03 14:35 
GeneralRe: Arrays and Threads Pin
Daniel Turini7-Jul-03 15:04
Daniel Turini7-Jul-03 15:04 
GeneralRe: Arrays and Threads Pin
albean7-Jul-03 18:02
albean7-Jul-03 18:02 
GeneralYankees Pin
eggie57-Jul-03 11:38
eggie57-Jul-03 11:38 
GeneralRe: Yankees Pin
Rocky Moore7-Jul-03 12:00
Rocky Moore7-Jul-03 12:00 

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.