I perform selects with linq to sql in my app and other things (insert,update,delete) by traditional sql syntax.
But, when I insert or delete something, my datacontext doesn’t update. So, if I search for the ID of selected object, an empty query returns. I checked the DB and I’m sure that sql syntax works fine.
In short, when I do something with my DB with sql syntax it changes my db but not the DataContext instance!
If you want to use Linq to Sql you should do all operations with that,It means if you want to do some raw Sql still you should use Linq to Sql syntax if not your link to data base won’t update.
So I switched to Linq to Sql completely.
Thanks All
Useful info : http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-1-introduction-and-model.aspx