在DOTNET建立连接 [英] CONNECTION ESTABLISHMENT IN DOTNET

查看:74
本文介绍了在DOTNET建立连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是对何时打开连接以及何时不在ADO.NET中打开连接感到困惑



请简要解释一下。



谢谢

解决方案

你能发给我,你的代码......,请

当我们编写,查询和获取命令对象,并指定我们在表中获取的所有参数时,然后在执行查询之后,我们必须打开一个连接,例如:

 cnn.Open(); 
cm.ExecteNonQuery();
cnn.Close();


i am always confused in the matter of when to open the connection and when not to open the connection in ADO.NET

please give anyone explanation in brief.

thank you

解决方案

Can you send me, your code..., please


When, ever we will write, Query, and take, command object, and specify all parameters, which we take in tables, then after..before Executing Query, we have to open a connection, example:

cnn.Open();
cm.ExecteNonQuery();
cnn.Close();


这篇关于在DOTNET建立连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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