如何使用lambda从book表中选择日期?

如何使用lambda从book表中选择日期?,lambda,Lambda,我有以下功能: var filtered_books = book_table.Where<Book>(d => d.CategoryID == Convert.ToInt32(drpCategory.SelectedItem.Value)); lstBooks.DataSource = filtered_books; lstBooks.DataBind(); var filtered\u books=book\u table.Where(d=>d.CategoryID==C

我有以下功能:

var filtered_books = book_table.Where<Book>(d => d.CategoryID == Convert.ToInt32(drpCategory.SelectedItem.Value));
lstBooks.DataSource = filtered_books;
lstBooks.DataBind();
var filtered\u books=book\u table.Where(d=>d.CategoryID==Convert.ToInt32(drpCategory.SelectedItem.Value));
lstBooks.DataSource=已过滤的书籍;
lstBooks.DataBind();

错误:
System.Core.dll中发生了类型为“System.ArgumentNullException”的异常,但未在用户代码中处理。

请编辑您的问题标签以包括语言(C#?)是否确保
drpCategory.SelectedItem
不为空?