views:

54

answers:

2

I would like bind grid view with 2 different tables that has no relation. Is it possible to do if so please guide me in achieving that

+1  A: 

You can pick the data from different sources to an iList collection and bind it to a grid.

Kangkan
Can i have an example or if any link please provide me
Dorababu
@Dorababu: It would have been easier had you gave some details of the data that you wish to publish. Its so because, normally there won't be any data that one user would like to see in a row of a grid that have no relation to each other. Imagine, someone scrolling through a grid having 10 columns of which the left five tells about browser share in websites and the right five column shows data of price growth in market.
Kangkan
I am having 2 tables namely custdetails and invoice. In custdetails i will have some data like email-id , name , customerId and all.. In my invoice i will invoiceId, customerid and other. Now i would like to search for the tools he purchased by entering his mail id which was from 1st table. If exists i would like to bind the data of second table to gridview along with the some fields in first table data like Name and Address.
Dorababu
@Dorababu: So you already have a relation between the two tables, the customerId is in both the tables. You can do a query like select Invoice.*, Customer.* from Invoice inner join Customer on customer.customerId = invoice.customerId where customer.emailId=@givenEmailId
Kangkan
Hey thanks a lot it works
Dorababu
+1  A: 

First retrieve data from different source in different Dataset. them merge both dataset and bind with gridview.

Pankaj Mishra