473,388 Members | 1,209 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

SQLCommand.Prepare method ???

Dear all,

I have read on article that the same SQL querry is call many time, for
perfomramce reaon it is needed to call the SQLCommand.Prepare method before
executing.

What does that prepare really do ? Is it caching somehow the whole select
statement ?

thanks for your reply
Serge
Jul 21 '05 #1
1 4403
It prepares the statement to be executed with the given parameters. The
bottom line is that with most systems you are still feeding an SQL statement
over the network to the server, prepare places all parameters with the
proper escaping int the statement before its sent over.

Alex

"serge calderara" <se************@discussions.microsoft.com> wrote in
message news:20**********************************@microsof t.com...
Dear all,

I have read on article that the same SQL querry is call many time, for
perfomramce reaon it is needed to call the SQLCommand.Prepare method
before
executing.

What does that prepare really do ? Is it caching somehow the whole select
statement ?

thanks for your reply
Serge

Jul 21 '05 #2

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

Similar topics

0
by: ProgDario | last post by:
HI, I spent all this afternoon to solve this problem, so I thought to write two lines to describe this strange behaviour..... - I'm using PHP with PEAR:DB package. - I set autocommit to false...
3
by: fmarchioni | last post by:
Hi all, I'm trying to do an insert using MySQL OleDb Provider. I'd like to use the prepare() method of OleDbCommand class to precompile the statement. The problem is that when I issue prepare() I...
1
by: Tom | last post by:
Hello guys Please have a look on following paragraph from ".NET Data Access Architecture Guide". ''''''''''' Although you can repeatedly use the same SqlCommand object to execute the same...
0
by: RG | last post by:
OleDbCommand.Prepare error: Size of parameter (VB.NET 2003) I need to do a SQL INSERT statement into an Access table, and I’d like to use the exact technique described in the Help file example...
1
by: serge calderara | last post by:
Dear all, I have read on article that the same SQL querry is call many time, for perfomramce reaon it is needed to call the SQLCommand.Prepare method before executing. What does that prepare...
0
by: Agnes | last post by:
I got a silly question about Sqlcommand . In my form, there are 5 methods which use the same sqlcommand to execute reader. I had create and dispose for each sqlcommand in every method. Some said...
20
by: John Bailo | last post by:
I have a c# program that loops through a table on a DB2 database. On each iteration it assigns data to values in the SqlParameter collection. The command text is an INSERT statement to a Sql...
10
by: John Bailo | last post by:
I want to pass a SqlCommand object as a input parameter to a method. I want to pass the SqlCommand "by value" so that any updates to the original object are *not* reflected in the object within...
2
by: sauve mark | last post by:
exec sp_prepare
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.