Results 1 to 4 of 4

Thread: ADO.NET equivelant of RS.AddNew?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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?

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    nope, i knew they existed, but haven't coded anything with them yet. I will look for some examples

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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
  •  



Click Here to Expand Forum to Full Width