.NETGURU
Want to know performance of CommandType missing on SP.
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdata' list.


George Pagotelis
Can anybody tell me what the difference between these two methods are
(missing the command type)? I was helping somebody and realized that in
the "old" days of asp3, SQL Server recognizes you are running a stored
procedure anyway.

a)
MyCommand = New SqlDataAdapter("spMySecretSP", MyConnection)
MyCommand.SelectCommand.CommandType = CommandType.StoredProcedure
DS = new DataSet()
MyCommand.Fill(DS, "Products")

b)
MyCommand = New SqlDataAdapter("spMySecretSP ", MyConnection)
DS = new DataSet()
MyCommand.Fill(DS, "Products")

Reply to this message...
 
    
Philip Q
There should no difference, but you can also set the CommandType to
'TableDirect' so that you can specify one or more table names and do the
equivalent of 'SELECT * FROM tablename'. I suppose it should be set for
clarification about what you are calling (SP or TableDirect).

--
Philip Quinn - Click here to reveal e-mail address
Anything Goes ASP -
http://www.aspalliance.com/wisemonk/

"George Pagotelis" <Click here to reveal e-mail address> wrote in message
news:674660@aspngdata...
[Original message clipped]

Reply to this message...
 
    
Ryan Garner
I have noticed that leaving that part out causes errors when you are using
Parameters in your sproc.

Regards,
Ryan G.

----- Original Message -----
From: "George Pagotelis" <Click here to reveal e-mail address>
To: "aspngdata" <Click here to reveal e-mail address>
Sent: Tuesday, June 25, 2002 12:54 AM
Subject: [aspngdata] Want to know performance of CommandType missing on SP.

[Original message clipped]

Reply to this message...
 
    
Michael Pizzo
When you specify that a command is CommandType.StoredProcedure, the
SqlClient actually executes the command as a remote procedure, passing
in a binary structure, as opposed to passing text that has to be
executed by the Query Processor on the server. If you don't specify
that the command is a stored procedure, you can invoke it as a query
that is parsed on the server, but this will be less efficient.

HTH,

-Mike
-----Original Message-----
From: Ryan Garner [mailto:Click here to reveal e-mail address]=20
Sent: Tuesday, June 25, 2002 10:51 AM
To: aspngdata
Subject: [aspngdata] Re: Want to know performance of CommandType missing
on SP.

I have noticed that leaving that part out causes errors when you are
using
Parameters in your sproc.

Regards,
Ryan G.

----- Original Message -----
From: "George Pagotelis" <Click here to reveal e-mail address>
To: "aspngdata" <Click here to reveal e-mail address>
Sent: Tuesday, June 25, 2002 12:54 AM
Subject: [aspngdata] Want to know performance of CommandType missing on
SP.

[Original message clipped]

| [aspngdata] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
 
System.Data.CommandType
System.Data.DataSet
System.Data.SqlClient.SqlDataAdapter




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification