asp.net:webconfig简单数据库配置
来源:互联网 发布:mmd舞蹈动作数据 编辑:程序博客网 时间:2024/04/30 08:24
一、 <!-- Maticsoft.Accounts权限角色管理模块连接字符串-->
<add key="ConnectionStringAccounts" value="server=127.0.0.1;database=codematic;uid=aa;pwd=111111"/>
<!--其它模块连接字符串,可以不断增加以便同一个项目支持连接多个数据库。如果没有,可以删除该行-->
<add key="ConnectionString2" value="server=127.0.0.1;database=aa;uid=aa;pwd=111111"/>
后台获取代码: string _connectionString = ConfigurationManager.AppSettings["ConnectionString"];
二、<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-User_webApp-20151205000953;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-User_webApp-20151205000953.mdf"/>
<add name="constr" connectionString="Data Source=(.)\v11.0;AttachDbFilename=|lixi|\db_NetStore.mdf;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="constr1" connectionString="Data Source=.;database=lixi;Integrated Security=True"/>
</connectionStrings>
数据库配置
字符串获取:
private static readonly string conString = ConfigurationManager.ConnectionStrings["constr1"].ConnectionString;
<add key="ConnectionStringAccounts" value="server=127.0.0.1;database=codematic;uid=aa;pwd=111111"/>
<!--其它模块连接字符串,可以不断增加以便同一个项目支持连接多个数据库。如果没有,可以删除该行-->
<add key="ConnectionString2" value="server=127.0.0.1;database=aa;uid=aa;pwd=111111"/>
后台获取代码: string _connectionString = ConfigurationManager.AppSettings["ConnectionString"];
二、<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-User_webApp-20151205000953;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-User_webApp-20151205000953.mdf"/>
<add name="constr" connectionString="Data Source=(.)\v11.0;AttachDbFilename=|lixi|\db_NetStore.mdf;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="constr1" connectionString="Data Source=.;database=lixi;Integrated Security=True"/>
</connectionStrings>
数据库配置
字符串获取:
private static readonly string conString = ConfigurationManager.ConnectionStrings["constr1"].ConnectionString;
0 0
- asp.net:webconfig简单数据库配置
- asp.net webconfig配置说明
- asp.net webconfig配置说明
- asp.net webconfig配置说明
- asp.net webconfig配置说明
- asp.net webconfig配置说明
- ASP.NET WEBCONFIG一些配置
- asp.net session 的配置 webconfig
- c# asp.net 修改webconfig文件 配置
- c# asp.net 修改webconfig文件 配置
- Asp.net webconfig
- ASP.NET的WebConfig
- .NET webconfig 配置地址
- asp.net webconfig下的httphandler模块配置
- ASP.NET在webconfig中配置默认启动项
- ASP.NET实现增删改查等功能(Access版)系统之一 -前台及数据库webconfig配置
- asp.net ajax webconfig设置
- asp.net 中webconfig文件
- SAP中采购订单状态与MRP的关系
- PRO-2 Day1
- 政治哲学与幸福根基 (David Miller )
- PCI 总线及地址空间
- 解决eclipse字体太小问题
- asp.net:webconfig简单数据库配置
- leetcode Single Number III
- NodeJS优缺点及适用场景讨论
- 魔兽,召唤燃情岁月
- 如何破解PDF文档无法复制
- 冒泡排序 查找排序
- OpenVPN连接后内网ping不通
- yield from
- hadoop单机环境搭建