这个问题我也很感兴趣,现在是这么做的
con.conectionstring="...";try
{con.open();    }
catch(Exception ee)
{MessageBox.shou(ee.message)}
con.close();不过感觉这样效率很地,当连接不成功时,要返回的时间很长,不知更好的方法是什么