在设置连接字符串 的时候 测试是否成功~~
SqlConnection mySqlConnection = null ;
try
{
mySqlConnection = new SqlConnection(this.txt_cMessage.Text);
mySqlConnection.Open();
System.Windows.Forms.MessageBox.Show("成功!");
mySqlConnection.Close();
}
catch
{
System.Windows.Forms.MessageBox.Show("失败!");
}