473,500 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLReader

Hi there,

I am using a SQL reader to read data from a table. Here is how I use it.

SqlDataReader lobj_Table = SqlHelper.ExecuteReader(ConnectionObject,CommandTy pe.Text,lstr_SQL);

Now I need to confirm a few points here. If I am reading the data from a single table then the sqlreader works fine. But one of my collegues mentioned that sql reader does not always work if my sql query consists of one or more joins. Is it true? It is important that I use SQL reader and not a datatable because of memory issues etc.

Please let me know what is the best way to read data from multiple tables using a sql reader.

Thanks and Regards,
Saurabh
Jul 15 '06 #1
3 2982
I believe you're talking about the SqlDataReader class. And your colleague
is dead wrong. A query is a query, and regardless of whether it is fetched
from 1 table or 100 tables, it is a single table when you fetch it.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Saurabh Prabhu" <sa***********@hotmail.comwrote in message
news:ei**************@TK2MSFTNGP03.phx.gbl...
Hi there,

I am using a SQL reader to read data from a table. Here is how I use it.

SqlDataReader lobj_Table =
SqlHelper.ExecuteReader(ConnectionObject,CommandTy pe.Text,lstr_SQL);

Now I need to confirm a few points here. If I am reading the data from a
single table then the sqlreader works fine. But one of my collegues
mentioned that sql reader does not always work if my sql query consists of
one or more joins. Is it true? It is important that I use SQL reader and not
a datatable because of memory issues etc.

Please let me know what is the best way to read data from multiple tables
using a sql reader.

Thanks and Regards,
Saurabh
Jul 15 '06 #2
I have never had a problem using joins with an SQL reader. I seldom have an
sql statement with out a join.
Jul 15 '06 #3
Thanks for the confirmation. I will go ahead with SQLDataReader class

Regards,
Saurabh

<ne***************@charter.netwrote in message news:G6*************@fe07.lga...
I have never had a problem using joins with an SQL reader. I seldom have an
sql statement with out a join.
Jul 17 '06 #4

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

Similar topics

2
1823
by: andrewcw | last post by:
I am seeing how the DataView ( dVue1) control works with this code - but something must be wrong since I am getting no rows. dVue1.DataSource = SqlHelper.ExecuteReader(strDefConnTxt,...
0
1532
by: Chris Morse | last post by:
Hi, Following is a function I wrote to export the rows of an arbitrary table. It's not complete yet, in that it currently does not output to a file (it uses Debug.WriteLine() at the moment) and...
3
1178
by: Agnes | last post by:
drBranchForm = sqldatareader For Each drBranch In dtUserBranch Do While drBranchForm.Read .......... Problem (A) Loop Next I found that the datarreader only loop onces , ?? How can I make it...
1
2181
by: Agnes | last post by:
I got 2 sql statment to check whether the account code exsist in one of their tables. and then want to get the counter. Thanks a lot. -----my vb.net syntax----- cmdSearch.Parameters.Add(New...
5
2544
by: c676228 | last post by:
Hi all, I am stuck with this problem. the code is like this: Dim sqlreader As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) ...
1
1223
by: Arpan | last post by:
A class file named "Users.vb" has the following code: Namespace Users Public Class UserDetails Public FirstName As String Public LastName As String Public UserName As String Public Password...
2
1862
by: rn5a | last post by:
This function in a VB class file takes UserID as a parameter & returns a SqlDataReader to the calling function which exists in a ASPX page: Namespace NConnect Public Class Cart Private sqlConn...
4
304
by: rn5a | last post by:
Assume that a ASPX page uses a user control named Address.ascx which has 2 TextBoxes. This ASCX page creates 2 properties named 'Address' & 'City' using the Get & Set statements: <script...
1
1303
by: rn5a | last post by:
A VB class file has the following code: Namespace MyNS Public Class MyClass Private sqlConn As New SqlConnection(".....") Public Function Categorize(ByVal Category As String) As...
0
7136
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,...
0
7018
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...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
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...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
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...
0
316
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...

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.