111,119
社区成员
发帖
与我相关
我的任务
分享
public static bool ConnectionTestWin(string servername, string database)
{
try
{
string strCon = "Data Source=" + servername + "\\SQLEXPRESS;Initial Catalog=" + database + ";Integrated Security=SSPI:";
SqlConnection con = new SqlConnection(strCon);
con.Open();
con.Close();
return (true);
}
catch
{
return (false);
}
}