我从网上下载了一份.net代码,运行过程中出现错误,是web.config的配置错误!
配置错误
说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 分析器错误信息: 无法识别的配置节“connectionStrings”源错误:
行 12: <add key="connstr" value="server=.;uid=xkzi;pwd=xkzi;Trusted_Connection=no;database=site"/>
行 13: </appSettings>
行 14: <connectionStrings>
行 15: <add name="connstr" connectionString="server=.;uid=xkzi;pwd=xkzi;Trusted_Connection=no;database=site"/>
行 16: </connectionStrings>
请问怎么处理啊?
配置错误
说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 分析器错误信息: 无法识别的配置节“connectionStrings”源错误:
行 12: <add key="connstr" value="server=.;uid=xkzi;pwd=xkzi;Trusted_Connection=no;database=site"/>
行 13: </appSettings>
行 14: <connectionStrings>
行 15: <add name="connstr" connectionString="server=.;uid=xkzi;pwd=xkzi;Trusted_Connection=no;database=site"/>
行 16: </connectionStrings>
请问怎么处理啊?
server=.;uid=xkzi;pwd=xkzi;Trusted_Connection=no;database=site
另外看你的配置文件, 写的不太标准, 可能是按照作者自己的方式读取的
你如果仅仅是为了学习代码, 可以直接找到读取connectionStrings的地方,直接赋你的连接字符串得了.