asp.net 下web.config中配置数据库连接
来源:互联网 发布:dns怎么解析域名 编辑:程序博客网 时间:2024/05/29 14:22
1、Web.config 可以采用写连接条件 或 附加 ×.mdf 文件
<connectionStrings>
<add name="Sales"
providerName="System.Data.SqlClient"
connectionString= "server=myserver;database=Products;uid=<user name>;pwd=<secure password>" />
<add name="LocalSqlServer"
providerName="System.Data.SqlClient"
connectionString="server=.;database=NorthWind;Integrated Security=SSPI" />
<add name="Sql2005Express"
connectionString="Data Source=./SQLEXPRESS;AttachDbFileName=|DataDirectory|NorthWnd.mdf;Integrated Security=True;User Instance=true"
providerName="System.Data.SqlClient"/>
</connectionStrings>
2、×.cs 连接数据库 代码
string connectionStr = System.Configuration.ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString();
3、MSDN - 索引 - connectionStrings 可以查看web.config里数据库连接或附加设置。
ms-help://MS.MSDNQTR.v90.chs/dv_aspnetgenref/html/b6ffbb2e-a4d1-410e-8f7e-9755e92c65de.htm
- asp.net 下web.config中配置数据库连接
- ASP.NET中使用web.config配置数据库连接
- ASP.NET中使用web.config配置数据库连接
- ASP.NET中使用web.config配置数据库连接
- ASP.NET中使用web.config配置数据库连接
- asp.net数据库连接web.config配置
- asp.net数据库连接web.config配置
- asp.net数据库连接web.config配置
- ASP.NET WEB.CONFIG 配置数据库连接
- ASP.NET中使用web.config配置web应用程序中的数据库连接
- ASP.NET中使用web.config配置web应用程序中的数据库连接
- ASP.NET中使用web.config配置web应用程序中的数据库连接
- ASP.NET中使用web.config配置web应用程序中的数据库连接
- ASP.NET web.config中数据库连接字符串connectionStrings节的配置方法
- ASP.NET web.config中数据库连接字符串connectionStrings节的配置方法
- ASP.NET数据库连接字符串写在config.web配置文件中
- ASP.NET数据库连接字符串写在config.web配置文件中
- ASP.NET加密和解密Web.config中数据库连接字符串
- jsp page指令中contentType 和pageEncoding区别
- FormXML.cs
- Linux内核解读入门
- C# 图片与byte[]之间以及byte[]与string之间的转换
- FormWMP.Designer.cs
- asp.net 下web.config中配置数据库连接
- JPA入门
- FormWMP.cs
- 超级猜数字(难度crazy)
- continuation monad
- 冬日的阳光
- Python发送天气预报信息到手机
- 我的Linux学习笔记
- c语言中的函数间的跳转函数setjmp和longjmp