Explicit conversion when comparing database values

MaFiA DITZ

New Member
I'm trying to select a row in my database by its ID and then select all rows that have a "Position" value higher than the row selected by ID, like this:\[code\]int id = Convert.ToInt32(Request.QueryString["id"]);MyDataContext d = new MyDataContextItem itemID = d.Items.Single(row => row.ID == id);Item itemPos = d.Items.Select(row => row.Position > itemID.Position);\[/code\]The bottom line is saying that an explicit conversion exists but I can't seem to fix itHaving read the answers so far, the code now looks like this:\[code\]int id = Convert.ToInt32(Request.QueryString["id"]);MyDataContext d = new MyDataContextItem itemID = d.Items.Single(row => row.ID == id);var itemPos = d.Items.Where(row => row.Position > itemID.Position);\[/code\]But then when I try and edit the Position of selected rows, it seems I am doing that wrong:\[code\]itemPos.Position = itemPos.Position - 1;\[/code\]I would have expected that line to reduce the current position by 1.
I'm still new to all this
 
Back
Top