views:

58

answers:

2

Is it efficient or possible to share same DbParameter object with multiple commands?

+2  A: 

No, One cannot. A quick check gave runtime exception.

Rohit
A: 

In general, if a class is mutable (ADO.NET parameters are quite definitely mutable), then it's a bad idea to do this.

By contrast, references to immutable classes can be shared between callers without any danger of corrupting data.

Christian Hayter