|
-
Jan 19th, 2003, 09:29 PM
#1
Thread Starter
Hyperactive Member
Save
I have tried this code to save records in C#.NET.
//Save
DataRow row = dataSet11.Student.NewStudentRow;
row.ItemArray(0) = textBox1.Text;
row.ItemArray(1) = textBox2.Text;
row.ItemArray(2) = textBox3.Text;
row.ItemArray(3) = textBox4.Text;
dataSet11.Student.AddStudentRow;
dataSet11.AcceptChanges;
But it doesn't work.
Any solution to this problem?
-
Jan 20th, 2003, 12:39 AM
#2
PowerPoster
Try using the 'Update' method of the dataAdapter object. 'AcceptChanges' tells the dataSet to reset its dirty flags.
-
Jan 20th, 2003, 04:56 AM
#3
Do you come from VB?
You need function parentheses even for argument-less functions:
dataSet11.AcceptChanges();
Also array indexing is done using brackets:
row.ItemArray[0]
or ItemArray might even be the indexer (look it up in the reference):
row[0]
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|