3

我有一个数据库,并且创建了一个 DBML Linq-to-SQL 文件来表示这个数据库。我创建了一个新的 aspx 页面并将一个 linqdatasource 和一个 formview 控件放到它上面。当我配置 linqdatasource 时,我只能选择从一个表中选择 * ......但我想从多个表中提取。例如,我有simple_person、simple_address、simple_phone 等表,我想从所有这些表中提取。我怎样才能做到这一点?

4

1 回答 1

6

使用自定义查询

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
于 2010-05-15T04:42:56.717 回答