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;

Re: Data Grid View And Database by Rodrigo

Rodrigo
Wed Mar 01 08:25:29 CST 2006

Problem solved.

"Rodrigo Ferreira" <rjrferreira@gmail.com> escreveu na mensagem
news:%23yzWu3SPGHA.2924@TK2MSFTNGP11.phx.gbl...
> 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;
>
>