connection.CreateCommand vs. new SqlCommand

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For a long time I have used CreateCommand to access stored procedures within our database. Now for performance reasons I would like to statically create the command with all of the parameters and just fill in the values at run time. This change requires me to switch from CreateCommand to new SqlCommand. In making this change I would like to query this group to see if there are any gotchas that I should be aware of

Kevi
(e-mail address removed)
 
Hi Kevin,

I can't think of any gotchas. Of course, you'll have to have synchronized
code with database (in case you change table structures or something like
that).
You might take a look at CodeSmith
http://www.ericjsmith.net/codesmith/.
It might help you creating all those code lines.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Kevin Burton said:
For a long time I have used CreateCommand to access stored procedures
within our database. Now for performance reasons I would like to statically
create the command with all of the parameters and just fill in the values at
run time. This change requires me to switch from CreateCommand to new
SqlCommand. In making this change I would like to query this group to see if
there are any gotchas that I should be aware of.
 
Back
Top