how to get the column name from data base to dat grid view
Design as follows in data grid view;
Date session CMK TMS MS CNN UNNI VB GS RV
18.9.2012 1
18.9.2012 2
18.9.2012 3
THE COLUMN NAME I MENTIONED AS CMK, TMS, MS, CNN, UNNI, VB, GS, RV
these name to be retrieved from the database and put in to the data grid view.
CMK TMS MS CNN UNNI VB GS RV
the above name to be retrieved from the data base and put it to data grid view.
how to do please help me.
Hemant SrivastavaPosted Jan 8, 2013, 3:08 PM
By default, Table[0] gets populated in a dataset.
Then just bind your DataGridView Control to that DataTable as:
dataGridView.DataSource = MyDataSet.Tables[0];
and after doing this, set AutoGenerateColumns property to TRUE.
That's it. You will get what you want.