vs2015如何鏈接sql數據庫

 一.點開工具中的鏈接到數據庫web

二.複製sql數據庫的服務器名到vs中sql

 

三.選擇鏈接的數據庫名稱數據庫

 

四.選擇高級屬性最下面的一行所有複製 獲得 Data Source = DESKTOP - DFOPNE4; Integrated Security = True服務器

 五.點開web.config,把複製到字符串的替換到ConnectionString的引號部位中工具

六.這時就有兩種鏈接方式能夠選擇了3d

 

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

相關文章
相關標籤/搜索