Hi,

Guys I have a peculiar problem here, I need to display data from two tables having no fields at all common and want to display them in one gridview on the click of a radio button .

If radiobuttton(1) is selected then data from table one will be displayed and if radiobuttton(2) is selected then data from table two will be displayed.

each of the table is having field name as:

table(1)

fname lname mname abid

table(2)

fname lname mname cdid

is there some advice you guys can help me?

thanks

You may have Result Datatable and add to it columns and rows manually.

Hi

You could always load both sets of data to seperate DataTables.
Then on the Radio Button Click just set the datasource of the DataGridView to the appropriate table.

MyDatagridView.DataSource = MyDataTable;

Regards

Hi guys maybe this more information will add some morte light to my problem:


each of the table is having field name as:

table(1)

fname lname mname abid

table(2)

fname lname mname cdid

gridview

fname lname mname abid

You can do as 'Mick Curley' suggested in the above post. Change the last column header when you change the table source.

Hi


Then on the Radio Button Click just set the datasource of the DataGridView to the appropriate table.


Regards

is it possible to do that?
I mean as far as I know the gridview's coloumn name should match exactly as that of the coloumn name of table(whose data to be displayed) it is bounded to....

The last column name is different.So keep some common name for the datagrid and both the tables, like fname , lname, mname and bid. Then assign the table. I am guessing all the columns are the same type in the gridview.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.