当从列表框选择可以在datagridview中编辑时,C#如何使用列表框中显示的数据库表
private void button4_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(this.connetionString);
string sql = @"SELECT * from amd_err;";
SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
sda.Fill(dt);
this.listBox1.DataSource = result;
this.listBox1.DataSource = dt;
listBox1.DisplayMember = "amd_err";