How to bind data to a DataGridView?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
bclayshannon
Posts: 29
Joined: Wed 14 Mar 2012 18:37
Location: Monterey, California

How to bind data to a DataGridView?

Post by 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?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by 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.

Post Reply