|
-
Jul 27th, 2004, 11:01 AM
#1
ADO.NET equivelant of RS.AddNew?
I have the datareader down, but that is like opening a recordset for forward readonly access.
So now I need to save a record to my table.
I know I can do an INSERT INTO db command, but is there anything similar to the old ADO recordset.AddNew method?
It is much easier to deal with than trying to put a string together for the insert as you have to check for ' and it gets messy with all the concatenation of strings
-
Jul 28th, 2004, 12:23 AM
#2
Use the dataset instead. You can add new rows to it, or edit an existing one, and then go fo an .Update()
Have you started with datasets yet, btw?
-
Jul 28th, 2004, 10:19 AM
#3
nope, i knew they existed, but haven't coded anything with them yet. I will look for some examples
-
Jul 28th, 2004, 10:29 AM
#4
You also have the option of EXECUTENONQUERY, and you'll need to create the SQL statements yourself.
ADO.NET quickstart:
http://samples.gotdotnet.com/quickst...sOverview.aspx
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
|