473,503 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What "type" is returned?

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
2 1480
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5012
by: Tim Johnson | last post by:
Hello All: I would like to expand upon the typeof operator. Using 'typeof' I can distinguish between string and array for instance, because typeof returns "object" for array. How can I...
3
4762
by: Maersa | last post by:
Hi All, Was anybody able to serialize the "Type" class properly using XmlSerializer().... Want to serialize and deserialze the Type in a string form, but can this be done ? myobj.Type =...
0
11002
by: SKC | last post by:
What I did before problem occured? Ans : When I REVOKE teh EXECUTE from a STORED PROCS called (SP1). and then re GRANTED the EXECUTE permission to SP1. SP1 is a SQL procedure on version 8 UDB....
12
4866
by: Charlie Zender | last post by:
Hi, I am unable to compile a large body of code with extremely pedantic compile time checks activate, so that warnings cause errors. With GCC 3.3.1, I do this with gcc -std=c99 -pedantic...
5
3914
by: cowgurl art | last post by:
Hey there. I will not pretend to know more than I do...I'm just getting my feet wet with Dreamweaver and MySql databases. What I'm trying to do is create a form that will allow members to submit an...
5
2954
by: Charles Packer | last post by:
In the code example below, why does the reference to gdk_pixbuf_new_from_file in main compile okay, but in subr2 gives the error "dereferencing pointer to incomplete type"? A search through this...
3
3486
by: dba | last post by:
Without giving a lot of script at this time, I am having a problem with php and form input type="hidden". Problem is that the hidden variable displays last line from database query. Some code....
1
12307
by: mato81 | last post by:
Hi all! I am a newbie to WSDL. I have a questions which has been driving me crazy... If I would have a WSDL with a types element somewhat like below, what is the point of the third last row...
2
1183
by: Haab | last post by:
What is the definition of "Type" in C#.Net? I know int, class etc are example s of f "Type" but could not decsribe what type is. Haab
0
7287
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,...
0
7349
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...
1
7008
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
7467
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...
0
5594
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,...
1
5022
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
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
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.