Very frustrating LINQ question
-
Hi, I've been wrestling with LINQ for some hours already trying to make it change the DB, but for some reason it refuses to modify it... I tried about everything, but couldn't manage to get the simplest inserts and updates to work, even though selects work perfectly. Not even stored procedures did the trick. I've uploaded my simplest example here: http://www.dotcore.co.il/linqtest.rar[^]. And as frustrating as it is, it didn't work... I tried on console and windows forms projects. If someone has any clue as to what the problem is, I'd be very glad to hear! Thanks. Julian.
-
Hi, I've been wrestling with LINQ for some hours already trying to make it change the DB, but for some reason it refuses to modify it... I tried about everything, but couldn't manage to get the simplest inserts and updates to work, even though selects work perfectly. Not even stored procedures did the trick. I've uploaded my simplest example here: http://www.dotcore.co.il/linqtest.rar[^]. And as frustrating as it is, it didn't work... I tried on console and windows forms projects. If someone has any clue as to what the problem is, I'd be very glad to hear! Thanks. Julian.
Perrin01 wrote:
I tried on console and windows forms projects.
Try on a WPF project :)
Giorgi Dalakishvili #region signature my articles #endregion
-
Perrin01 wrote:
I tried on console and windows forms projects.
Try on a WPF project :)
Giorgi Dalakishvili #region signature my articles #endregion
OK, it worked without problem in WPF. But I really need it to work on a Win Forms project. And I don't manage to see why it doesn't work... Edit: When I tried updating, I tried it in a database in the server, and not in a database in the project. Now I tried in a database in a project, and it doesn't work either...
modified on Wednesday, June 25, 2008 10:28 PM
-
OK, it worked without problem in WPF. But I really need it to work on a Win Forms project. And I don't manage to see why it doesn't work... Edit: When I tried updating, I tried it in a database in the server, and not in a database in the project. Now I tried in a database in a project, and it doesn't work either...
modified on Wednesday, June 25, 2008 10:28 PM
Can you show us the code you're using to make changes to your database? If you're using Linq to SQL, are you calling SubmitChanges[^] on your DataContext?
-
Can you show us the code you're using to make changes to your database? If you're using Linq to SQL, are you calling SubmitChanges[^] on your DataContext?
Finally found what the problem was. Instead of using the DB in the project's folder, Visual Studio copies the database to the debug folder each time it compiles the project, so I didn't see an change, because the changes were saved to the wrong DB... So I can go on now