.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

Most Efficient Way to Load One-to-Many Data

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :Sql Server

I need to load one-to-many data from a database into memory. This isn't my real data, but an example of how I want to organize the data in memory is defined below.

class Order
  public int ID { get; set; }
  public DateTime OrderDate { get; set; }
  public decimal Total { get; set; }

class Customers
  public int ID { get; set; }
  public string Name { get; set ]
  public List<Order> Orders { get; set; }
The many side (Order) becomes a collection within each item on the one side (Customer). This is the sa

View Complete Post

More Related Resource Links

huge number of data from database ... so how to minimize load time


Hi ...

I have used the above method to configure my crystal report ...

Its working fine , But i have huge number of data in database ....

So , it take long time to load the report ...

So , i have decided to show only the last 50 records inserted into the database , not all the 500 records to be loaded every time.

Plz help me with this issue  ...


Also , Plz explain me abt index legend in crystal report.

Data Points: Efficient Coding With Strongly Typed DataSets


Someone once said to me that the hallmark of a good developer is the desire to spend time efficiently. Developers are continually pursuing ways to make coding easier and faster, and to reduce the number of errors.

John Papa

MSDN Magazine December 2004

Data: More Load, Less Code with the Data Enhancements of ASP.NET 2.0


A data source control is a server control that wraps some basic functions of a data source - be it a SQL Server database, an XML document, an Excel worksheet, or a sitemap description. Through the services of a similar component, data-bound controls can fetch data as well as insert new records or update and delete existing ones. Data source controls enable a consistent model across a variety of data sources and dramatically reduce the amount of code needed to implement a two-way data-binding scenario. This article provides an introduction to data source controls and other related data binding features.

Dino Esposito

MSDN Magazine June 2004

Marshalling Your Data: Efficient Data Transfer Techniques Using COM and Windows 2000


The way you choose to transfer data is vitally important in a distributed application. Windows 2000 provides several new features that allow you to transfer data more efficiently. Lightweight handlers allow you to write smart proxies that can cache results and perform buffered reads and writes, minimizing the number of network calls. Windows 2000 also allows you to use pipe interfaces to transfer large amounts of data efficiently through a read-ahead facility. This article illustrates several ways to improve data transfer in Windows 2000 using these new features. It also reports the results of transfer time tests and provides recommendations for transferred buffer sizes.

Richard Grimes

MSDN Magazine September 2000

Ajax Accordion to load data from client click event


I have a Ajax Accordion control on my page with treeview in Content Template. As the treeview for each pane are big. I am wondering whether I can load the treeview from codebehind only after the pane is selected. I can reuse the code from ItemDataBound of Accordion control.

System.Data.SqlClient.SqlException: Bulk load data was expected but not sent

Hi everyone We've had this error twice now from our C# code. Nothing is changing the columns, but I've noticed though that it appears to happen when two threads are attempting to bulk insert into the same table, generally millions of rows. The docs say that SqlBulkCopy.WriteToServer is not guaranteed to be thread-safe, but is this the problem here? It feels like it. I've seen some posts where people appeared to have experienced problems in similar circumstances (http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/85d51484-6381-46bc-bcce-63b58b362d2d). There is no identity column just a non-unique clustered index that is (spid) process keyed to each thread. Do I need to synchronise access to the table for WriteToServer - is this a known problem? Many thanks Reg --- System.Data.SqlClient. SqlException: Insert bulk failed due to a schema change of the target table.   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal()   at System.Data.SqlClient.SqlBulkCo

How to use OPENXML to load XML data into existing SQL Table?

I am a newbie to OPENXML. But I am trying to load a .XML file into a SQL table that I created for this. I do not receive any errors with this code, but it doesn't insert any records either. This is the table I created in 2008 SQL Server: CREATE TABLE HOMEROOM( HOMEROOM_TEACHER INT, HOMEROOM_NUMBER INT, ENTITY_ID INT) And this is the T-SQL code I am trying to execute: DECLARE @idoc int DECLARE @xmlDocument varchar(MAX) DECLARE @Status INT SET @xmlDocument =' <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="RowsetSchema"> <s:ElementType name="row" content="eltOnly"> <s:AttributeType name="c0" rs:name="HOMEROOM-TEACHER" rs:number="1" rs:nullable="true"> <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true" /> </s:AttributeType> <s:AttributeType name="c1" rs:name="HOMEROOM-NUMBER" rs:number="2"> <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="10" rs:maybenull="false" /> </s:AttributeType> <s:Attri

Could not load file or assembly "System.Data.DLL" or one of its dependencies

Could not load file or assembly "System.Data.DLL" or one of its dependencies

Unable to load data into a LookUp column in sharepoint using sharepoint destination

I have loaded details of a customer on a list and was able to load the data with out any problem using sharepoint list destination. We have a lookup column called customerid looking at customer list  . This lookup column is in another list, called Customer Main, so I am trying to load additional data for customer in this customer Main  list which contains a lookup column called customerID. I was not able to load data into this cutsomerid, whereas rest of the data is coming into sharepoint with out any problem. How should I load data into a lookup column. Thanks  

Steps by steps to load data

Hi Experts, Can anyone list the steps for loading a dimension data from a sql database in  ssis to a dimension in ssas? Thanks in advance!

Re creating indexes while data load - Performance Consideration



In the ETL design we have followed drop index before data load and recreate it after load. But looks like this approach is time consuming.

Is there any better data load design approach? Will table partition solve this problem?


- JL

Incremental data load from MySQL database to SQL server 2008 using SSIS


I am looking for best solution to perform incremental data load from MySQL database to SQL Server 2008.  I tried to follow instructions from articles on incremental data load in SSIS  using MD5 hashes but I failed to make connection in Lookup transformation editor between MySQL Id (4 byte unsigned integer) and Id in SQl Server 2008 table which is  bigint. i tried to add  data conversion and convert MySQl Id to string. It works fine when you map this field directly to OLEDB destination but in Lookup component it failed. 


Any input greatly appriciated.



Failed to find or load the registered .Net Framework Data Provider.




I am using enterprise library 5.0,vs.net 2008,oracle 9i,odp.net version.

In machine.config I added the line below in

<add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory , Oracle.DataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342"/>


DbProviderFactory pf = DbProviderFactories.GetFactory("Oracle.DataAcess.Client");

above line is throwing an error.

System.Configuration.ConfigurationErrorsException was unhandled by user code

Message="Failed to find or load the registered .Net Framework Data Provider."


BareMessage="Failed to find or load the registered .Net Framework Data Provider."



at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)

at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

at testweb2008.Classes.test..ctor(String strKey) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\testweb2008\testweb2008\Classes\test.cs:line 30

at testweb2008._Default.Page_Load(Object sender

Unable to load data from txt file with text delimiter specified, if the data has the same character


Have come across a strange scenario and seeking your ideas/thoughts.

I'm using a ssis package to load a txt file. The txt file is text delimited by double quote (") and column delimited by tilde (~). It works fine in most scenarios and strips the enclosing "" from the columns -no problems there. However, in a specific scenario where the last column has double quote in the data as well being the text delimiter, the package throws the following exception indicating that it's missing a column delimiter

 The column delimiter for column "COL_NAME" was not found

This behaviour was not observed when double quotes were present as data in any other column in the file. Was able to workaround by disabled text delimiter only for the last column, but that isn't a perm solution. Also observed that if the " was replaced by escape sequence /" the file loaded successfully. Wondering if this a known issue ?


load data to an Oracle destination


hi all,

1.how to fastload data to an Oracle destination.

2.what if i need to add an identity column to the destination table.

  Is a sequence needed? how can ssis2008 handle that?


thanks in advance.

How do I load BDC data from a BDC URL?


I am doing this in SharePoint 2010, but couldn't find any BDC/BCS forum for SharePoint 2010.  I believe it would be the same problem in either, however, so hopefully someone can help me here.

I have a runtime security trimmer on my BDC data.  I was expecting the security trimmer to give me URLs based off of the "default" profile URL defined in the model.  Unfortunately, that is not the case.  It gives me a URL like:


I need to get the properties of this object (really just the primary key value).  Any idea how I do this with the BDC object model?  The following link seems to provide some help, but I haven't seen anything that consumes the URL above.


ssis how should i load data from excel to Xml destination



could any one tell me how could i load data from EXCEl file to XML
if some one could provide with appropriate link then it will b  a great help

i have  taken Excel source part is completed ..but what to do after that..


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