Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Very frustrating LINQ question

Very frustrating LINQ question

Scheduled Pinned Locked Moved LINQ
csharpdatabasedotnetwinformslinq
5 Posts 3 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    perrin4869
    wrote on last edited by
    #1

    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.

    G 1 Reply Last reply
    0
    • P perrin4869

      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.

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Perrin01 wrote:

      I tried on console and windows forms projects.

      Try on a WPF project :)

      Giorgi Dalakishvili #region signature my articles #endregion

      P 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        Perrin01 wrote:

        I tried on console and windows forms projects.

        Try on a WPF project :)

        Giorgi Dalakishvili #region signature my articles #endregion

        P Offline
        P Offline
        perrin4869
        wrote on last edited by
        #3

        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

        J 1 Reply Last reply
        0
        • P perrin4869

          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

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          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?

          P 1 Reply Last reply
          0
          • J Judah Gabriel Himango

            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?

            P Offline
            P Offline
            perrin4869
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups