输入banner图图片脚本导航/分类

第十六部分SQL连接的三种方式

sqlconnection.ConnectionString =

     "Server=(local);DataBase=EduBaseHos;Integrated Security=sspi";

方法二:

 sqlconnection.ConnectionString =                    "Server=(local);DataBase=EduBaseHos;uid=jsj;pwd=2wsx@WSX";

方法三:当SQL的服务器为:本机名称\SQLEXPRESS,用以上两个方法连接时,均会出现连接错误。因而应采用以下方法:

String connection =

@"Data Source=.\sqlexpress;Initial Catalog=EduBase2018;Integrated Security=sspi";

SqlConnection sqlConnection = new SqlConnection(connection);

第十六部分SQL连接的三种方式

标签:pwd   方式   rate   serve   ted   服务器   ini   ase   family