相关疑难解决方法(0)

结束使用关闭打开的SQL连接

如果我在一个Using中包装一个SQLConnection,我应该关闭它还是使用句柄来结束它?

using cn as new system.data.sqlclient.sqlconnection()
    cn.open
    '{do a bunch of other stuff with commands and datareaders here}
    cn.close 'Do I need this?
end using 
Run Code Online (Sandbox Code Playgroud)

.net sql vb.net sql-server

64
推荐指数
3
解决办法
3万
查看次数

标签 统计

.net ×1

sql ×1

sql-server ×1

vb.net ×1