.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Bulk Copy Operations in ADO.NET 2.0

Posted By: Syed Shakeer Hussain     Posted Date: August 21, 2010    Points: 2   Category :ADO.Net

Bulk copying of data from one data source to another data source is a new feature added to ADO.NET 2.0. Bulk copy classes provides the fastest way to transfer set of data from once source to the other.

Each ADO.NET data provider provides bulk copy classes. For example, in SQL .NET data provider, the bulk copy operation is handled by SqlBulkCopy class, which is described in Figure 1. As you can see from Figure 1, data from a data source can be copied to one of the four types - DataReader, DataSet, DataTable, or XML.

View Complete Post

More Related Resource Links

Bulk Copy From Datatable To SQL Server Table


 I have read the data of a excle file and captured the data into the dataset to a datatable, now that data is to be inserted into a SQL Server table using bulk copy option. I am using -

 public bool BulkEnterData(DataTable dt, string tblName)
        SqlBulkCopy bulk = new SqlBulkCopy(con);
        bulk.DestinationTableName = tblName;

        return true;

ERROR Getting-
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.) 

How to resolve the above problem or any other solution is available.


Bulk copy from SQL Server to a managed app on network.


I am dealing with a perf issue.

We have code (SQL CLR triggers) that can take a few changes from a table and send them over a network to a recipient server, this recipient caches the data in memory, and appears as a .Net collection to local apps running on the recipinet server (there is no SQL server running on the recipient).

As changes are made to the table in SQL server, the managed trigger gets these, packs them into a class we designed (that stores rows/columns and some other details) and then uses binary serialization to send them over the network, the recipinet server (a managed code NT service) deserializes and updates its local cached copy.

The network IO is done by our own simple classes that use TcpClient and so on.

As a trigger this works OK, so I leveraged the trigger code so that I can also use it to pre-populate the remote server, by "pretending" every row has been changed and just sending the data, so we use the C# trigger library as a bulk upload from SQL Server to our remote recipient.

But this is proving far too slow, I am still pinning down why and where, but suspect the network cost is high, 10 rows from a table with 10 columns ends up being sent as a serialzied blob 10,500 byte long, or about three times the size of the raw data bytes in the rows.

So our bulk upload is taking hours for ve

database mirroring "log records from bulk-logged operations cannot be sent to mirror database"?


does this mean only when bulk recovery model or apply to full recovery model as well? if applys to full recovery model, how the mirror database be synchronized after bulk operation?

Bulk Copy From XML needs internet access???


I am using bulk copy in c# to import some data I exported from another SQL server.  Everything works fine until I no longer have the internet.  During the import it throws an error on all the data types.

I am exporting the data into an XML that includes the schema definition.  I then bring that into a DataTable with the schema definition and run SqlBulkCopy.

Why is SQL or c# trying to resolve the microsoft schema on import.  The schema came from the sql server?

This app has to work in isolation in some locations and this is a major show stopper.  I never thought that SQL could not handle its own schema definition during SqlBulkCopy.

Any help would be much appreciated.


How to Perform SQL Server Row-by-Row Operations Without Cursors

SQL cursors have been a curse to database programming for many years because of their poor performance. On the other hand, they are extremely useful because of their flexibility in allowing very detailed data manipulations at the row level. Using cursors against SQL Server tables can often be avoided by employing other methods, such as using derived tables, set-based queries, and temp tables

Visual Web Developer 2010 Express "Copy Web Site" using different login


I created a site and am trying to grant another pesron access to upload changes to it without giving them my super-user login.

I made a login for her but I can't test whether it works or not because no matter how much I "disconnect" in the Copy Web Site page of VWD 2010, reconnecting to the same site always logs in as my superuser account without prompting me for a login again.

How do I test is the account it set up correctly before having her try to upload to it?    I want to force the login to remote site dialog to pop up again to test her account.

Any ideas?

How to send bulk sms from asp.net


Hi experts,

I want to send and receive sms in my asp.net website.I am currently targetting users in India.I may need to send the same sms to thousands of users at the same time.How can I achieve this?

Thanks in advance

.NET Matters: Parallelizing Operations With Dependencies


In this month's installment, Stephen Toub examines some techniques for enforcing dependencies in the running order of asynchronous operations and builds a DependencyManagement class to help.

Stephen Toub

MSDN Magazine April 2009

ASP.NET Workflow: Web Apps That Support Long-Running Operations


Integrating workflow into ASP.NET applications means communicating with activities via a workflow queue and hosting the runtime in the global application class. We'll show you how.

Michael Kennedy

MSDN Magazine January 2009

Concurrent Affairs: Asynchronous Device Operations


Jeff Richter uses the AsyncResult class to implement the CLR's Asynchronous Programming Model to perform hardware device operations asynchronously.

Jeffrey Richter

MSDN Magazine June 2007

Visual Studio 2005: Bridge the Gap Between Development and Operations with Whitehorse


Microsoft is introducing a new suite of tools (code-named "Whitehorse") that will make it easier for you to design and implement systems that conform to a service-oriented architecture. Two of these tools -- the SOA Design Suite and the Class Designer -- support the graphical design of systems and components with support for code generation and support for bi-directional synchronization which lets you ensure that your diagram always represents your system design. This article introduces these tools and shows you how they'll improve your design and development efforts.

Brian A. Randell and Rockford Lhotka

MSDN Magazine July 2004

An operations error occurred in ActiveDirectoryMembershipProvider


Hi guys, i have an application that uses Active Directory Authentication and deployed the application several days ago without any error. Today, I got this error.please refer to the image. I find it  weird because I didn't change any code to my webconfig file since i deployed the application to the server. I've notice that it's working if it's http://localhost:50618/website/login.aspx (by opening the source file in server and debug it) however when i try to access the application through I'm getting this error. I'm using 2.0 framework

And here's my web.config

        <add name="ADConnectionString" connectionString="LDAP://,DC=com"/>

 <identity impersonate="true"/>
        <membership defaultProvider="MyADMembershipProvider">
                <add name="MyADMembershipProvider" 
                type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=,               Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

Unable to copy/move wiki pages with links to other wiki pages

When I try to copy or move wiki pages from one 'Wiki library A' to 'Wiki library B' through 'content and structure', I get an error for the pages which contain links to other wiki pages, does sameone has a clue how to fix this:

<error><message>Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd.</message><full>Microsoft.SharePoint.SPException: Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd. ---&gt; Microsoft.SharePoint.SPException: Het item bestaat niet. Mogelijk is het door een andere gebruiker verwijderd. at Microsoft.SharePoint.SPListItem.EnsureItemIsValid() at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(Guid newGuidOnAdd, Boolean bMigration, Boolean&amp; bAdd, Boolean&amp; bPublish, Object&amp; objAttachmentNames, Object&amp; objAttachmentContents, Int32&amp; parentFolderId) at Microsoft.SharePoint.Deployment.ListItemSerializer.AddOrUpdateDoclibItem(SerializationInfoHelper infoHelper, SPListItem&amp; listItem, SPWeb web, Guid newId, String&amp; listItemServerRelativeUrl, Boolean bIsPublish, Boolean exists, StreamingContext context, ISurrogateSelector selector, ImportObjectManager objectManager) at Microsoft.SharePoint.Deployment.ListItemSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurr
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend