不可引用成员不能像c3中的方法那样使用

时间:2018-11-24 08:14:06

标签: .net data-binding

private void btnView_Click(object sender, EventArgs e)
{
    MySqlConnection db_connection = new MySqlConnection(dbConnection);

    db_connection.Open();
    string query = "select * from tblUsers";
    MySqlCommand cmd = new MySqlCommand(query);
    MySqlDataReader dr = cmd.ExecuteReader();

    dataGridViewUsers.DataSource = dr;
    dataGridViewUsers.DataBindings();

    db_connection.Close();
}

0 个答案:

没有答案