views:

428

answers:

3

how to join two datatable datas into one datatable to show in one gridview

i.e in 1 datatable i have username and pwd and in another datatable i have that user details. how to show all these in one datatable to get those values display in gridview(asp.net)

any idea????

A: 

What you need is a join on the tables before reading them into a DataTable: SQL Joins

Beerdude26
no not using join, wat i need is searching the datas with the cell in gridview. like that.(searching the datas using dynamic queries)
Ranjana
Just noticed that you were looking for the Merge method, which I suggested as a solution first, but then deleted it because I was uncertain what your problem was. You should give the lay-out of the two tables next time :)
Beerdude26
A: 

@Ranjana have a look at this MSDN article it deals with what you want..

Pandiya Chendur
thanks for this article . it may help me
Ranjana
A: 

You can merge two datatable, here is the sample for that. http://msdn.microsoft.com/en-us/library/system.data.datatable.merge.aspx

Thurein