日期:2014-05-17 浏览次数:20661 次
private void button2_Click(object sender, EventArgs e)
{
try
{
string str="";
conn.Close();
if (conn.State == ConnectionState.Closed)
{
str="数据库已经成功关闭\n";
}
conn.Open();
if (conn.State == ConnectionState.Open)
{
str += "数据库已经成功打开\n";
}
richTextBox1.Text = str;
}
catch (Exception ex)
{
richTextBox1.Text = ex.Message;
}
}