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

R

Rob Dob

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top