SQLReader

  • Thread starter Thread starter Saurabh Prabhu
  • Start date Start date
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
 
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
 
I have never had a problem using joins with an SQL reader. I seldom have an
sql statement with out a join.
 
Back
Top