开发者

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

开发者 https://www.devze.com 2022-12-12 06:16 出处:网络
Is it efficient or possible to share same DbParameterobject wi开发者_JAVA技巧th multiple commands?No, One cannot. A quick check gave runtime exception.In general, if a class is mutable (ADO.NET parame

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

精彩评论

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