private void button2_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=PCName;Initial Catalog=DBName;Integrated Security=True");
//conn.Open();
if (conn.State == System.Data.ConnectionState.Open)
{
MessageBox.Show("测试连接成功!", "提示!");
}
else
{
MessageBox.Show("连接不成功!","提示!");
}
}
private void button3_Click(object sender, EventArgs e)
{
string PCName = this.texPCName.Text.Trim();
string DBName = this.texDBName.Text.Trim();
}
谁能教一下思路吗?