配置文件内容为
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
在配置节点中添加connectionStrings节点
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--数据库连接字符串-->
<connectionStrings>
<add name="ConnectionToNorthwind"
connectionString="Data Source=localhost;Initial Catalog=数据库名;UserID=sa;password=123456"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>