出现这种情况的原因,很大一部分原因是因为数据库的连接字符串错误。

 

一:先说一下数据库连接字符串都有哪些格式:

1 Data server=./SQLEXPRESS;Initial Catalog=Northwind;User ID=**;Password=******
2 Data Server=服务器名/SQLEXPRESS;Initial Catalog=Northwind;User ID=**;Password=******
3 Data Server=localhost/SQLEXPRESS;Initial Catalog=Northwind;User ID=**;Password=******
4 Data Server=.;Initial Catalog=Northwind;User ID=**;Password=******
5 Data Server=服务器名;Initial Catalog=Northwind;User ID=**;Password=******
6 ………………

 

二:解决方法:

1.SQL server 配置管理器中的服务是否已经开启。

2.检查字符中的格式是否正确,是否少写了中间的分号,或是漏写了字母等。

 

 

相关文章:

  • 2021-06-02
  • 2022-01-07
  • 2021-12-07
  • 2021-03-31
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-04-22
  • 2021-11-13
  • 2021-11-27
  • 2021-07-04
相关资源
相似解决方案