SQLReader

S

Saurabh Prabhu

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,CommandType.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
 
K

Kevin Spencer

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.


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,CommandType.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
 
N

newscorrespondent

I have never had a problem using joins with an SQL reader. I seldom have an
sql statement with out a join.
 
S

Saurabh

Thanks for the confirmation. I will go ahead with SQLDataReader class

Regards,
Saurabh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top