日期:2014-05-18 浏览次数:20825 次
SqlConnection sqlConn = new SqlConnection("packet size=4096;user id=sa;data source=.;persist security info=True;initial catalog=Data;password=pass"); try { sqlConn.Open(); MessageBox.Show("连接成功!"); } catch (Exception exp) { MessageBox.Show(exp.Message); } finally { sqlConn.Close(); }