Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQDataSource - Query Multiple Tables?

I have a database and I've created a DBML Linq-to-SQL file to represent this database. I've created a new aspx page and dropped a linqdatasource and a formview control onto it. When I configure the linqdatasource it gives me the choice only to select * from one table...but I want to pull from multiple tables. e.g. I have tables like simple_person, simple_address, simple_phone, and I want to pull from all of them. How can I accomplish this?

like image 870
Dave Mackey Avatar asked Mar 08 '26 10:03

Dave Mackey


1 Answers

Use a custom query

http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx

See: Using the <asp:LinqDataSource> Selecting Event
like image 196
Raj Kaimal Avatar answered Mar 11 '26 02:03

Raj Kaimal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!