开发者

LINQDataSource - Query Multiple Tables?

开发者 https://www.devze.com 2022-12-30 22:21 出处:网络
I have a da开发者_JAVA技巧tabase 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

I have a da开发者_JAVA技巧tabase 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消