I am using Entity Framework, and I have a line of code that is taking a var and translating it back to an iint for the database.
var record = context.enrollm
This works for me:
var iId = int.Parse(TextBox1.Text); var item = db.Items.Where(p => p.ItemID == iId ).FirstOrDefault();
To make that work you should convert your textbox value outside of the lambda expression.