本地数据库,数据库名bids,sa密码:123页面文件:
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);Web.config:
<appSettings>
<add key="ConnectionString" server=(local); value="database=bids; persist security info=False;user id=sa;pwd=123" />
</appSettings>出错提示:
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 '(' character, hexadecimal value 0x28, cannot begin with a name. Line 5, position 46.Source Error:
Line 3:
Line 4: <appSettings>
Line 5:
<add key="ConnectionString" server=(local); value="database=bids; persist security info=False;user id=sa;pwd=123" />
Line 6: </appSettings>
Line 7:
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);Web.config:
<appSettings>
<add key="ConnectionString" server=(local); value="database=bids; persist security info=False;user id=sa;pwd=123" />
</appSettings>出错提示:
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 '(' character, hexadecimal value 0x28, cannot begin with a name. Line 5, position 46.Source Error:
Line 3:
Line 4: <appSettings>
Line 5:
<add key="ConnectionString" server=(local); value="database=bids; persist security info=False;user id=sa;pwd=123" />
Line 6: </appSettings>
Line 7:
解决方案 »
- c#.net无边框窗口的拖动!
- 同时回滚2个事务的问题
- 一个非常非常简单的程序以每秒4K的速度吃内存! 附代码,求优化
- 求救遍历文件夹下的所有图片以及子文件夹里的图片,并且能实现删除图片,急!!!!!!!
- 怎样才能返回一个引用,而不是副本?
- XML文件导入数据库 为什么总提示“对于不返回任何基表信息的 SelectCommand 不支持动态 SQL 生成”,网上找不到答案的问题,郁闷中
- 结构数组的问题
- System.Convert.ToDateTime("")的问题,大家帮忙,多谢!!!
- 在将文件复制到临时文件夹时出现位置错误,安装程序将立即退出。
- 大家好!请教个问题!!!急!!!
- 100分求助,怎样获得当前登录页面的用户的信息(域帐户)
- C# 串口通信的群 1402238 (GPS,电台等设备,手机短信).分数100
这样些写你试试
<appSettings>
<add key="ConnectionString" value="server=(local); database=bids; persist security info=False;user id=sa;pwd=123" />
</appSettings>appSettings 设置里一个key 对应一个Value