hi everyone
i am using asp.net and link to display a set of books from the db. n it gives me an error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0118: 'int' is a 'type' but is used like a 'variable'
Source Error:
Line 48: using(MobileBooksDataContext categoryList = new MobileBooksDataContext())
Line 49: {
Line 50: int catID = Int32(CategoryName.SelectedItem);
Line 51: var newBookList = from b in categoryList.team5_bookmobiles
Line 52: where(b.ca_id == catID)
protected void getBookList()
{
using(MobileBooksDataContext categoryList = new MobileBooksDataContext())
{
int catID = Int32(CategoryName.SelectedItem);
var newBookList = from b in categoryList.team5_bookmobiles
where(b.ca_id == catID)
select new
{
lblBook_name = b.book_name,
lblBook_author = b.book_author,
lblBook_shortdesc = b.book_short_desc
};
lv_Books.DataSource = newBookList;
lv_Books.DataBind();
}
}
protected void btn_Select_Click(object sender, EventArgs e)
{
getBookList();
}
i take the category id from a drop down list and match it against the category id of books that is in a different table.