Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I want to bind a gridview to multiple tables.
I have a gridview and three database tables, and now what i want is three columns in my gridview each column should be coming from different table.

You can use this statement in your Query

SELECT c.Email, o.OrderTotal, orn.Note FROM tblCustomer c
INNER JOIN tblOrder o ON c.CustomerID = o.CustomerID
INNER JOIN tblOrderNote orn on o.OrderID = o.OrderID
Share this answer
As I getting you want o display Column datas from three different table in to one Gridview if so then you can use JOIN to bind data from multiple table to one gridview or even you can also use Merge method of Datable where Merge method is used specified DataTable with the current DataTable. otherwise
Multiple Tables in one DataGridView[^]
Share this answer
HI arvind you have a query that states that select c,Email, gacve compleare the mainnptri so ckim 9).
Share this answer

Thanks to all for replying, the links provided by thatraja are very helpful to meet my requirement.
Share this answer
Hello sir,
Thank you for replying ..

would u pls provide some sample code in c#...

Share this answer

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900