blogs-qq2685054765

 一.点开工具中的连接到数据库

二.复制sql数据库的服务器名到vs中

 

三.选择连接的数据库名称

 

四.选择高级属性最下面的一行全部复制 得到 Data Source = DESKTOP - DFOPNE4; Integrated Security = True

 五.点开web.config,把复制到字符串的替换到ConnectionString的引号部位中

六.这时就有两种连接方式可以选择了

 

static string strcon = "server=DESKTOP-DFOPNE4;Integrated Security=SSPI;database=Library;";
SqlConnection con = new SqlConnection(strcon);

 

分类:

技术点:

相关文章:

  • 2021-11-09
  • 2022-01-28
  • 2021-11-28
  • 2021-11-27
  • 2021-08-16
  • 2021-05-25
  • 2021-11-19
猜你喜欢
  • 2021-12-08
  • 2021-10-24
  • 2022-12-23
  • 2021-06-13
  • 2021-11-27
  • 2021-08-12
  • 2021-11-07
相关资源
相似解决方案