473,796 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fastest way to load data

I have to call a stored procedure which returns about 1000 rows with
about 5 fields (most of them are int).

What is the fastest way to load this data?

if I just do DataTable.Load, then is it fast? or should I do something
else?

Thanks

Feb 12 '07 #1
3 3520
You can either get a DataReader or a DataSet. DataReader keeps the open
connection and is "Firehose" style one way access through your data. If you
need to be able to work with the data after closing the connection, then you
need to get a DataSet. DataSet has more overhead, but with only 1000 rows and
5 columns, you would never be able to notice the difference. Check out the
QUICKSTARTS samples for example code.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Sehboo" wrote:
I have to call a stored procedure which returns about 1000 rows with
about 5 fields (most of them are int).

What is the fastest way to load this data?

if I just do DataTable.Load, then is it fast? or should I do something
else?

Thanks

Feb 12 '07 #2
P.S. DataTable Load method uses a supplied DataReader "under the hood".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Sehboo" wrote:
I have to call a stored procedure which returns about 1000 rows with
about 5 fields (most of them are int).

What is the fastest way to load this data?

if I just do DataTable.Load, then is it fast? or should I do something
else?

Thanks

Feb 12 '07 #3

I would just use BULK INSERT

ADO.net doesn't have _HALF_ of the performance / functionality as ADO
Classic

On Feb 12, 1:22 pm, "Sehboo" <MasoodAd...@gm ail.comwrote:
I have to call a stored procedure which returns about 1000 rows with
about 5 fields (most of them are int).

What is the fastest way to load this data?

if I just do DataTable.Load, then is it fast? or should I do something
else?

Thanks

Feb 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
408
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges files/datatables... Should I use the IO.Stream? The XmlReader/XmlWriter?
4
3562
by: laurenq uantrell | last post by:
I am trying to determine which of three stored procedure designs are fastest in the Query Analyzer: One query is a straight SELECT query with all desired rows and a dozen (tblName.RowName = @param or @param = Null) filters in the WHERE statement. One query populates a #Temp table with the UniqueIDs from the results of the SELECT query in the above example, then joins that #Temp table to get the desired rows.
0
1509
by: chad kline | last post by:
i have searched around for an answer to this question, but haven't found a satisfactory answer. i understand things like mmap(2) can be used to quickly load a file - but it seems to be a function for "read-only" situtations. it doesn't appear to be useful in situations where editing must be done on the loaded file. the next fastest method (based on my searches) seemed to be a fread(3)/read(2) loop. however, malloc(3)'s seems to slow
11
2118
by: Ignacio X. Domínguez | last post by:
Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would like to be able to retrieve the name by searching for a given phone number the fastest I can. I have considered the posibility of using XmlTextReader with something like: <list> <item number="1234567"> <name>John Doe</name>
60
49203
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
1
1489
by: TKapler | last post by:
I got a javasscript based aplication, which is working with data from server (php&sql, changed once per week or so). Actualy I use a xml as a data format with structure e.g. I open read the file through XMLHttpRequest and then i do smtg like items = documentElement.getElementsByTagName("item"); for i=0 to items.lenght { var1=item.getAttribute("var1") ....
4
5644
by: Jörgen Ahrens | last post by:
Hi All VS 2005 SP1 (C#, VB.NET) I need the absolut fastest way of loading an xml-file of about 700KB into an array. I need to load about 1500 of those xml-Files into arrays on startup of my application. Therefore it needs to be as fast as possible.
3
2061
by: Code Monkey | last post by:
DataTable loading a SqlDataReader (dt.Load())? Vanilla DataTable using SqlDataAdapter or SqlDataReader ? or is there a better way using Generics? If so, how? Essentially I want to get about 50-100 rows of data (2 columns) out of my database and use this is serveral places without caching it as the data could get updated several times during a period of 5 minutes and thus, needs to be always up-to-date.
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.