CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005
    Posts
    178

    insert dataset into database

    is there a way to insert values (many rows) from dataset to the dataBase?
    thnaks in advanced.

  2. #2
    Join Date
    Jul 2006
    Posts
    59

    Re: insert dataset into database

    There are several approaches you can take.

    If you need to log for example any row that fails, you could use the DataAdapter's Update method call on the database. Keep in mind though that if you have a large amount of rows, this will be extremely slow since you will be executing a sql command for each row.

    If you just want to do "all or none" import of data, look into SqlBulkCopy. Extremely fast and should be used if you have to import many rows.
    If my posts have helped you, please rate them. Ratings give me that warm, fuzzy feeling of having helped someone out

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

Featured