电影管理系统修改后,为啥不能识别数据库
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>
再次运行程序,结果正常!
实事求是,不自以为是