How to bind data to a DataGridView?

How to bind data to a DataGridView?

Postby bclayshannon » Thu 15 Mar 2012 21:12

I can retrieve data this way:

Code: Select all
            while (myReader.Read())
            {
                MessageBox.Show(myReader.GetString(0));
             }


...but I really want to put all of the data into a DataGridView control. Is that possisble? If so, how?
bclayshannon
 
Posts: 29
Joined: Wed 14 Mar 2012 18:37
Location: Monterey, California

Postby Pinturiccio » Tue 20 Mar 2012 08:27

bclayshannon wrote:...but I really want to put all the data into a DataGridView control. Is that possisble? If so, how?

You cannot bind data from DataReader to DataGridView control. As a workaround, you can put all of the data into DataTable and then bind Datatable to DataGridView control.
Pinturiccio
Devart Team
 
Posts: 2044
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle