为什么我们需要在断开连接模式下打开连接和关闭连接? [英] Why we need to Open Connection and Close Connection in Disconnected Mode?

查看:100
本文介绍了为什么我们需要在断开连接模式下打开连接和关闭连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们需要在断开的架构模式下打开连接和关闭连接?

Why we need to Open Connection and Close Connection in Disconnected Architecture Mode?

推荐答案

当您使用SqlDataAdapter类对象时,您不需要打开()和关闭( )连接因为它有自己的功能来打开和关闭连接本身。



但总是使用使用块,因为它会破坏你的Connection对象。
When you using SqlDataAdapter Class Object you not need to Open() and Close() Connection Because it's has own Feature to Open and Close Connection itself.

But always use Using block because it will destroy your Connection object.


这篇关于为什么我们需要在断开连接模式下打开连接和关闭连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆