.NET网站转移之后怎么样连接数据库
时间:2011-07-29
来源:互联网
我是没有玩过ASP、.NET和MSSQL的人
服务器硬盘出问题了,紧急转移网站和数据库。
现在在新硬盘上面,安装了SQL2005(验证方式为window登录),附加了之前的数据库sports,网站找了很多文件,老是连接不了数据库
web.config设置如下
IIS还需要设置什么吗?
未命名.JPG (48.58 KB)
未命名2.JPG (50.19 KB)
服务器硬盘出问题了,紧急转移网站和数据库。
现在在新硬盘上面,安装了SQL2005(验证方式为window登录),附加了之前的数据库sports,网站找了很多文件,老是连接不了数据库
web.config设置如下
IIS还需要设置什么吗?
复制内容到剪贴板
<configuration>
<connectionStrings>
<add name="strCon" providerName="SqlServer" connectionString="Data Source=127.0.0.1;Integrated Security=SSPI;Initial Catalog=sports;"/>
</connectionStrings>
<system.web>
<pages styleSheetTheme="Default"/>
<httpHandlers>
<!--添加ajax设置-->
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>
<!--上传文件大小限制-->
<httpRuntime executionTimeout="600" maxRequestLength="102400" useFullyQualifiedRedirectUrl="false"/>
<compilation debug="false" />
<authentication mode="Forms">
<forms name="Sports" loginUrl="Login.aspx" protection="All" path="/"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="RemoteOnly" defaultRedirect="Error.htm">
</customErrors>
</system.web>
</configuration>
代码:
<?xml version="1.0" encoding="utf-8"?><configuration>
<connectionStrings>
<add name="strCon" providerName="SqlServer" connectionString="Data Source=127.0.0.1;Integrated Security=SSPI;Initial Catalog=sports;"/>
</connectionStrings>
<system.web>
<pages styleSheetTheme="Default"/>
<httpHandlers>
<!--添加ajax设置-->
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>
<!--上传文件大小限制-->
<httpRuntime executionTimeout="600" maxRequestLength="102400" useFullyQualifiedRedirectUrl="false"/>
<compilation debug="false" />
<authentication mode="Forms">
<forms name="Sports" loginUrl="Login.aspx" protection="All" path="/"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="RemoteOnly" defaultRedirect="Error.htm">
</customErrors>
</system.web>
</configuration>
附件

2011-7-29 11:06

2011-7-29 11:06
作者: aeleven 发布时间: 2011-07-29
把你服务器的.Net版本调整到2.0或以上……
作者: xxs8418 发布时间: 2011-07-30
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28