Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet to BindingSource to DataGridView

Status
Not open for further replies.

andegre

MIS
Oct 20, 2005
275
US
I don't know why I'm having such a hard time with this, but it will not show up in my DataGridView. Here's the code, does anyone know what's wrong with it?

Code:
        private void BindToGrid(DataSet dataSource)
        {
            if (dataSource != null)
            {
                BindingSource bSource = new BindingSource();
                bSource.DataSource = dataSource;
                bSource.DataMember = dataSource.Tables[0].TableName;
                
                grdResults.DataSource = bSource;
            }
            else
            {
                MessageBox.Show("Invalid datasource!");
            }
        }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top