最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
二种asp.net连接数据库代码
时间:2022-06-25 05:06:45 编辑:袖梨 来源:一聚教程网
//方法一
string strconn2 = system.configuration.configurationmanager.connectionstrings["connectionstring"].connectionstring;
sqlconnection conn = new sqlconnection(strconn2);
if (conn.state!=connectionstate.open)
{
conn.open();
}
//方法二
string strconn = system.configuration.configurationmanager.apps教程ettings.get("connectionstring");
sqlconnection conn = new sqlconnection(strconn);
if (conn.state!=connectionstate.open)
{
conn.open();
}
//如何要保存数据的话就
string insertsql = "....要保存的数据哦,www.111com.net";
sqlcommand insertcommand=new sqlcommand(insertsql,conn);
insertcommand.executenonquery();
相关文章
- 快手网页版一键直达指南 12-14
- bilibili官方入口-b站视频官网首页直达 12-14
- 中国移动139邮箱官网-139邮箱官方登录入口 12-14
- 羞羞漫画APP全平台下载官网-安卓/iOS/鸿蒙极速安装入口 12-14
- 学信网学籍信息查询入口-在线查询学籍状态 12-14
- 死神BLEACH手游官网入口-死神BLEACH手游一键登录入口 12-14