开发者

Can DbParameter instance of same name and type be shared with multiple DbCommand instances?

Is it efficient or possible to share same DbParameter object wi开发者_JAVA技巧th multiple commands?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜