PETSHOPS数据库问题
初学ASP.NET,刚把PETSHOP 4.0装上,BUILD之后,测试运行
出现这个
=========================
Server Error in '/Web ' Application.
--------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The connection name 'HUAN-66A420192D\SQLEXPRESS ' was not found in the applications configuration or the connection string is empty.
Source Error:
Line 113: <sqlCacheDependency enabled= "true " pollTime= "10000 ">
Line 114: <databases>
Line 115: <add name= "MSPetShop4 " connectionStringName= "HUAN-66A420192D\SQLEXPRESS " pollTime= "10000 "/>
Line 116: </databases>
Line 117: </sqlCacheDependency>
Source File: C:\Program Files\Microsoft\.NET Pet Shop 4.0\Web\web.config Line: 115
================================
HUAN-66A420192D\SQLEXPRESS这个是我数据库的SERVER,不知道甚么还这样提示,初级问题请多多帮忙,自己找了不知道错在哪里
------解决方案--------------------首先需要在app.config xml 文件里面配置好数据库连接字符串
<add name= "SQLConnString1 " connectionString= "server=HUAN-66A420192D\SQLEXPRESS;user id=sa;password=pwd;database=MSPetShop4;min pool size=4;max pool size=4;packet size=3072 " providerName= "System.Data.SqlClient "/>
这里你换成你自己得数据库服务器和用户密码就可以了。
connectionStringName= "HUAN-66A420192D\SQLEXPRESS "
改为
connectionStringName= "SQLConnString1 "
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html