SqlDataSource读取Web.Config连接字符串
来源:互联网 发布:阿里云域名管理在哪里 编辑:程序博客网 时间:2024/05/20 17:10
把数据库的连接字符串写在Web.Config文件中,方便Asp.net页面读取
Web.Config文件
<configuration>
<connectionStrings>
<add name="sqlStringData"
providerName="System.Data.SqlClient"
connectionString="Data Source=DB_IP;Initial Catalog=DB_Name;User ID=xxx;Password=yyy"/>
</connectionStrings>
... ...
</configuration>
ASP页面文件
... ...
<asp:GridView ID="gvSQLServer" DataSourceID="sqlData" runat="server" />
<asp:SqlDataSource ID="sqlData"
SelectCommand="select top 10 * from tableName"
ConnectionString="<%$ ConnectionStrings:sqlStringData %>"
runat="server" />
</div>
... ...
- SqlDataSource读取Web.Config连接字符串
- Web.config中的sqlserver连接字符串+读取
- web.config 连接字符串
- 读取web.config中连接字符串的方法
- 怎样从web.config中读取连接字符串的设置
- 取Web.config连接字符串
- 加密web.config连接字符串
- web.config中的连接字符串
- ASP.NET SqlDataSource中使用web.config 共享数据库连接字符串(详细)
- 从app.config中读取连接字符串
- ORM读取web.config中的数据库连接字符串
- WinForm 读取Web.config 中数据库连接字符串
- 从Web.config文件中读取连接字符串的两种方法
- 在web.config中添加连接字符串
- 在web.config中添加连接字符串
- 调用web.config文件中的连接字符串
- 如何加密Web.Config中的连接字符串
- web.config里写access连接字符串
- 简单的注册表单页面
- 《将博客搬至CSDN》
- JTA 深度历险 - 原理与实现
- 预处理指令习题分享2(附答案哦)
- 【win7无法识别u盘的解决办法】
- SqlDataSource读取Web.Config连接字符串
- JAXB解析xml文件转换为POJO
- Android学习笔记之AndroidManifest.xml文件解析
- 【绿色】四步骤搞定专属PE系统
- nyoj-27-水池数目
- date 今天是本周的第几天
- VB.NET中用API实现打开文件夹
- 转载 : 汇编中的ASSUME
- Android源码中屏幕截图的实现