private void button1_Click(object sender, EventArgs e)
{
SqlConnectionStringBuilder scsb = new SqlConnectionStringBuilder();//定义一个实例,连接字符串的构造者
propertyGrid1.SelectedObject = scsb;
}
private void button2_Click(object sender, EventArgs e)
{
SqlConnectionStringBuilder scsb = (SqlConnectionStringBuilder)propertyGrid1.SelectedObject;
MessageBox.Show(scsb.ConnectionString.ToString());
}