1、设置Web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="TestConnStr1" connectionString="user id=hgjg@sa;password=jhyrf765_67;Data Source=localhost;Initial Catalog=DB1;" providerName="System.Data.SqlClient" />
<add name="TestConnStr2" connectionString="user id=hgjg@sa;password=jhyrf765_67;Data Source=localhost;Initial Catalog=DB2;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
2、获取数据:

本文介绍了如何使用ASPX进行数据库操作,包括配置Web.config文件,从数据库中获取数据,以及执行存储过程的方法。
最低0.47元/天 解锁文章
96

被折叠的 条评论
为什么被折叠?



