public partial class Form7 : Form
{
private MySqlDataAdapter da;
private MySqlConnection conn;
BindingSource bsource = new BindingSource();
DataSet ds = null;
string sql;
public Form7()
{
InitializeComponent();
}
private void LoadData()
{
string connectionString = "Data Source=localhost;database=d1; uid=root; password=123;port=3307;";
conn = new MySqlConnection(connectionString);
sql = "SELECT Name, Address, id, Status FROM t1";
da = new MySqlDataAdapter(sql, conn);
conn.Open();
ds = new DataSet();
MySqlCommandBuilder commandBuilder = new MySqlCommandBuilder(da);
da.Fill(ds, "Orders");
bsource.DataSource = ds.Tables["Orders"];
dgv.DataSource = bsource;
}
}
エラーコールが表示されます:
dgv does not exist in the current context
修正するにはどうすればよいですか? パッケージなどを使用する必要がありますか?