473,569 Members | 2,683 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.ExecuteRead er(CommandBehav ior.CloseConnec tion);

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(C onfigurationSet tings.AppSettin gs["ConnectionStri ng"]);

SqlCommand cmd = new SqlCommand("Emp loyeesList", conn);

cmd.CommandType = CommandType.Sto redProcedure;

conn.Open();

DataGrid1.DataS ource = cmd.ExecuteRead er(CommandBehav ior.CloseConnec tion);

DataGrid1.DataB ind();
Nov 18 '05 #1
2 1483
Hi,

It returns System.Data.Sql Client.SqlDataR eader. See
http://msdn.microsoft.com/library/en...eaderTopic.asp

Greetings
Martin
"Lasse Edsvik" <la***@nospam.c om> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
Hello

I was wondering if you guys could tell me if:

cmd.ExecuteRead er(CommandBehav ior.CloseConnec tion);

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(C onfigurationSet tings.AppSettin gs["ConnectionStri ng"]);

SqlCommand cmd = new SqlCommand("Emp loyeesList", conn);

cmd.CommandType = CommandType.Sto redProcedure;

conn.Open();

DataGrid1.DataS ource = cmd.ExecuteRead er(CommandBehav ior.CloseConnec tion);

DataGrid1.DataB ind();

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.c om> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
Hello

I was wondering if you guys could tell me if:

cmd.ExecuteRead er(CommandBehav ior.CloseConnec tion);

returns a dataset, datatable or what?

SqlConnection conn = new
SqlConnection(C onfigurationSet tings.AppSettin gs["ConnectionStri ng"]);

SqlCommand cmd = new SqlCommand("Emp loyeesList", conn);

cmd.CommandType = CommandType.Sto redProcedure;

conn.Open();

DataGrid1.DataS ource = cmd.ExecuteRead er(CommandBehav ior.CloseConnec tion);

DataGrid1.DataB ind();

Nov 18 '05 #3

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

Similar topics

4
5019
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 programmatically distinguish between an Array and an Option, for instance? Thanks
3
4776
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 = typeof(System.String) as <type>System.String</type> thanks a ton.
0
11030
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. What was the problem? Ans : Application failed with the following error:
12
4867
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 -Wall -Wunused -Werror -W -Wmissing-prototypes -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -c -o foo.o foo.c
5
3917
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 audio file (mp3 or .wav) from a website. The form will insert the record into the database IF I can get it configured correctly. Here's the...
5
2962
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 newsgroup suggests that the error arises when the proper header files are missing, but when the header file I've got is sufficient to compile one...
3
3491
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. if ($field_name=="member_lname") { echo "<input type='radio' name='selection' value=' " . $result. ',' .$result ." ' " . $result . ', ' . $result ...
1
12313
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 "<s:element name="string" nillable="true" type="s:string"/>". Why is it there and what is it for? ... <wsdl:types> <s:schema...
2
1190
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
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7673
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.