views:

225

answers:

2

Is there a way to tell Enterprise Library to use prepared statements? If so, how?

A: 

You should be able to obtain the sqlConnection / Command being executed -> can't you set the relevant setting here before executing ??

Hope I've got the right end of the stick...

ip
+2  A: 

The short answer is to use DbCommand.Prepare();

The long answer is that it is completely irrelevant, and results in a noop, when calling stored procedures.

Also, it should only really be used when the code is about to make several calls (as in a loop) with the same query.

Chris Lively