R
Rodrigo Ferreira
Hello i have some problems with load values to a datagridview.
I can´t put the data from a database into a datagridview.
My code is:
Base.bd bd1 = new Base.bd();
OleDbCommand c1 = new OleDbCommand("SELECT * FROM table1");
c1.Connection = bd1.getConn();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = c1;
da.Fill(ds);
dgvModulos.AutoGenerateColumns = false;
dgvModulos.DataSource = ds;
I can´t put the data from a database into a datagridview.
My code is:
Base.bd bd1 = new Base.bd();
OleDbCommand c1 = new OleDbCommand("SELECT * FROM table1");
c1.Connection = bd1.getConn();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = c1;
da.Fill(ds);
dgvModulos.AutoGenerateColumns = false;
dgvModulos.DataSource = ds;