Try doing the conversion first:
int id = Convert.ToInt32(txtboxId);
demo db = (from c in ob.demoes
where c.id == id
select c).FirstOrDefault();
db.name = txtboxName.Text;
db.salary = int.Parse(txtboxSalary.Text);
ob.SaveChanges();
But it should be unnecessary. Certainly, it works fine in normal Linq:
int id = 66;
string sid = "66";
List<MyClass> list = new List<MyClass>();
MyClass mc = new MyClass();
mc.id = 55;
list.Add(mc);
mc = new MyClass();
mc.id = 66;
list.Add(mc);
var x = (from c in list
where c.id == id
select c).FirstOrDefault();
var y = (from c in list
where c.id == Convert.ToInt32(sid)
select c).FirstOrDefault();
Compiles and runs fine, and x and y both contain the same instance.