1 <?xml version="1.0" encoding="utf-8" ?>2 <configuration>3 <connectionStrings>4 5 <add name="str" connectionString="Data Source = ./SQLExPRess2008; Initial Catalog=Movie;Integrated Security=True"/> 6 </connectionStrings>7 </configuration>
在App.config配置文件中,主机名并没有改成自己的主机名,导致无法识别,更改后如下:
1 <?xml version="1.0" encoding="utf-8" ?>2 <configuration>3 <connectionStrings>4 5 <add name="str" connectionString="Data Source=PC201503301006;Initial Catalog=Movie;Integrated Security=True"/>6 </connectionStrings>7 </configuration>
再次运行程序,结果正常!
新闻热点
疑难解答