How do I create a insert command that will take a datatable or datarow as a parameter

Discussion in 'ASP .Net' started by Rob Dob, Sep 28, 2006.

  1. Rob Dob

    Rob Dob Guest

    How do I create a insert command that will take a datatable or datarow as a
    parameter instead of me having to supply it with parameters for each field
    value. I heard something about using the v2.0 SqlHelper class (MS Data
    Application Block), however I don't have a clue how to use this and
    wondering if using it would be more work then entering in the 50 fields. Am
    I better off just modifying the insert command that was created
    automatically at the time I created the tableadapter? if so does that mean
    that if I reconfigure the table adapter then I will have to remodify the
    insert command. The reason for me doing all this is that I have one
    identity field within the select statement of my table adapter and when I
    try and do an insert it fails with an error so therefore I will need to
    remove the identity field from the insert command, but I would still like
    the value returned to me in the select command.

    any help or suggestions come very welcomed,

    thanks
    Rob Dob, Sep 28, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fredrik Rodin

    Sort a datatable and create a new datatable

    Fredrik Rodin, Feb 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    9,046
    paul.mariotti
    Sep 28, 2007
  2. ypul
    Replies:
    3
    Views:
    41,575
  3. Rob G
    Replies:
    0
    Views:
    2,016
    Rob G
    Jun 7, 2004
  4. jg
    Replies:
    1
    Views:
    724
    =?Utf-8?B?U2hhaWxlc2ggSmFubnU=?=
    Aug 17, 2004
  5. Bennett Haselton
    Replies:
    0
    Views:
    681
    Bennett Haselton
    Nov 11, 2004
Loading...

Share This Page