473,386 Members | 1,712 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,386 software developers and data experts.

Prep

exec sp_prepare
Nov 21 '06 #1
2 2506
Sorry guys,

It seems that Prepare command does not work for me, I'm using the following
code:

SqlCommand Cmd = new SqlCommand("SprocName", DBConnection);
Cmd.CommandType = CommandType.StoredProcedure;

Cmd.Parameters.Clear();
Cmd.Parameters.Add("@Param1", SqlDbType.BigInt, 0).Value = x
Cmd.Parameters.Add("@Param2", SqlDbType.VarChar, 128).Value = x
....

CmdMessage.Prepare();
Cmd.ExecuteNonQuery();

In SQL Profiler I'm excepting to see
exec sp_prepare ... command but this is not the case, I cann see only the
exec sproc statement

Is this is a normal behaviour and Prepare() method works only for Queries
not for sprocs or am I missing something ?

Thank you a lot for your help


Nov 21 '06 #2
Hi,

"If CommandType is set to StoredProcedure, the call to Prepare should
succeed, although it may cause a no-op."

"SqlCommand.Prepare Method"
http://msdn2.microsoft.com/en-gb/lib...d.prepare.aspx

--
Dave Sexton

"sauve mark" <sa*******@yahoo.comwrote in message
news:uQ**************@TK2MSFTNGP02.phx.gbl...
Sorry guys,

It seems that Prepare command does not work for me, I'm using the
following code:

SqlCommand Cmd = new SqlCommand("SprocName", DBConnection);
Cmd.CommandType = CommandType.StoredProcedure;

Cmd.Parameters.Clear();
Cmd.Parameters.Add("@Param1", SqlDbType.BigInt, 0).Value = x
Cmd.Parameters.Add("@Param2", SqlDbType.VarChar, 128).Value = x
...

CmdMessage.Prepare();
Cmd.ExecuteNonQuery();

In SQL Profiler I'm excepting to see
exec sp_prepare ... command but this is not the case, I cann see only the
exec sproc statement

Is this is a normal behaviour and Prepare() method works only for Queries
not for sprocs or am I missing something ?

Thank you a lot for your help


Nov 22 '06 #3

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

Similar topics

7
by: D | last post by:
I have been working with Oracle as web developer for three years, I have 13 years of database (SQL Server, DB2) experience and I'm getting a masters degree in CS, but don't expect to finish for 2...
17
by: Jochen Luebbers | last post by:
Hi, I've a problem: I compile modules of embedded SQL (for a dynamic lib) on multiple platforms (AIX,Linux,Windows). They are compiled from the same source code. To be able to provide all...
1
by: Analyst | last post by:
I'm trying to figure out how, from the Visual C++ GUI, to run a precompiler on my .SQC files, and create the corresponding .C files. I know about the DB2 command window, and how to do a DB2 PREP...
0
by: jhon | last post by:
www.exams.ws provide exam prep at very good price. The material provided is of good standard. It deals in all major vendors like MICROSOFT, CISCO, ORACLE, COMPTIA,…… -- jhon...
1
by: Vijay | last post by:
CSQA & CSTE Prep Courses for International Certifications by QAI,USA @Hyderabad After receiving overwhelming response to our last 50+ batches, SpectraMindSolutions.com now announces a new...
0
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
0
by: jhon | last post by:
Exams.ws provide exam prep at very good price. The material provided is of good standard. It deals in all major vendors like MICROSOFT, CISCO, ORACLE, COMPTIA,…… -- jhon...
0
by: shiggy | last post by:
Hello, I am writing embeded application (actualy web aplication) but i have problem during precompilation There is a front page server that handles http requests and delivers those requests to...
6
by: crack.the.hack | last post by:
Hi All, If I am changing the database machine, what should I do not to prep bind the sqc files everytime. Because I need to build my application everytime the database is changed? Is there...
0
by: Vijay | last post by:
Prep Courses for International Certifications by QAI,USA After receiving overwhelming response to our last 95 batches, Spectramind now announces a new batch of Prep Courses for CSQA & CSTE so as...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
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...

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.