i am trying to display the ID number by using this query
IQueryable<ToDoList> todolistQuery = from c in context.ToDoList where c.Title == NavigationContext.QueryString["Title"] & c.Description == NavigationContext.QueryString["Desc"] & c.Id == NavigationContext.QueryString["Id"] select c;
This Line:
c.Id == NavigationContext.QueryString["Id"]
has a red underline below it stating int ToDoList.Id Error: Operator '==' cannot be applied to operands of type 'int' and 'string'
What have I actually done wrong? How do I solve it? Thanks
Convert your NavigationContext.QueryString["Id"]
to integer
:
c.Id == Convert.ToInt32(NavigationContext.QueryString["Id"])
And it should be fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.