日期:2014-05-17 浏览次数:20944 次
private void btn_connect_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThreadStart(ConnectionTest));
th.IsBackground = true;
th.Start();
}
void ConnectionTest()
{
try
{
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}