By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,495 Members | 1,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,495 IT Pros & Developers. It's quick & easy.

What "type" is returned?

P: n/a
Hello

I was wondering if you guys could tell me if:

cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);

SqlCommand cmd = new SqlCommand("EmployeesList", conn);

cmd.CommandType = CommandType.StoredProcedure;

conn.Open();

DataGrid1.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

DataGrid1.DataBind();
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

It returns System.Data.SqlClient.SqlDataReader. See
http://msdn.microsoft.com/library/en...eaderTopic.asp

Greetings
Martin
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:OW**************@TK2MSFTNGP15.phx.gbl...
Hello

I was wondering if you guys could tell me if:

cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);

SqlCommand cmd = new SqlCommand("EmployeesList", conn);

cmd.CommandType = CommandType.StoredProcedure;

conn.Open();

DataGrid1.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

DataGrid1.DataBind();

Nov 18 '05 #2

P: n/a
Hi Lasse,

Here is a link to the free Microsoft .Net SDK, which will answer this
question as well as any future questions you have regarding any .Net Common
Language Runtime Classes:

http://www.microsoft.com/downloads/d...displaylang=en

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Lasse Edsvik" <la***@nospam.com> wrote in message
news:OW**************@TK2MSFTNGP15.phx.gbl...
Hello

I was wondering if you guys could tell me if:

cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);

SqlCommand cmd = new SqlCommand("EmployeesList", conn);

cmd.CommandType = CommandType.StoredProcedure;

conn.Open();

DataGrid1.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection) ;

DataGrid1.DataBind();

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.