Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3217940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:28:11+00:00 2026-05-17T15:28:11+00:00

I have a dataset in ADO.NET containing multiple records from user side. I need

  • 0

I have a dataset in ADO.NET containing multiple records from user side. I need to insert all those rows in single query into the database, in order to avoid multiple queries

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:28:12+00:00Added an answer on May 17, 2026 at 3:28 pm

    Maybe something like a Bulk copy would be an answer. The example in Code Project below show how to do it using a DataTable, but you should be able to change the example around to use a DataSet.

    Below is an small part of the code which covers to conenction and exection in SQL Server (taken from CodeProject).

    The key part to notice is the bulkcopy.WriteToServer(SourceTable); were the SourceTable would be the part of the DataSet you would pass to it

    //First create a connection string to destination database
    string connectionString;
    connectionString = <EM>YourConnectionString</EM>and
        Initial Catalog=TestSMODatabase";
    
    //Open a connection with destination database;
    using (SqlConnection connection = 
           new SqlConnection(connectionString))
    {
       connection.Open();
    
       //Open bulkcopy connection.
       using (SqlBulkCopy bulkcopy = new SqlBulkCopy(connection))
       {
        //Set destination table name
        //to table previously created.
        bulkcopy.DestinationTableName = "dbo.TestTable";
    
        try
        {
           bulkcopy.WriteToServer(SourceTable); // SourceTable would come from your DataSet
        }
        catch (Exception ex)
        {
           Console.WriteLine(ex.Message);
        }
    
        connection.Close();
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints.
I have a Static Dataset and i want to Distinct Records from this DataSet
I have a DataSet which I get a DataTable from that I am being
I have a DataSet populated from Excel Sheet. I wanted to use SQLBulk Copy
Suppose I have a dataset with those two immortal tables: Employee & Order Emp
I'm trying to build a strongly-typed dataset in ADO.Net and am having a little
I have a dataset containing the start and end points (both OSGB36 and corresponding
I have xmlDoc.DataSet.Tables[<tablename>].Columns I want to loop through those columns via DataColumn , for
I have a dataset. I added a column Tags. I need to run a
I have a melted dataset containing a column value which represent an absolute number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.