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. Linq : Insert doesn't work

Linq : Insert doesn't work

Scheduled Pinned Locked Moved LINQ
helpcsharpdatabaselinqquestion
3 Posts 2 Posters 0 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.
  • M Offline
    M Offline
    Mr programboy
    wrote on last edited by
    #1

    I use the following code in this function : public void VoegNieuwDossierToe(string pDossierNr, int pSectId) { Invordering invordering = new Invordering(); invordering.INVO_DOS_NR = pDossierNr; invordering.INVO_SECT_ID = pSectId; dc.Invorderings.InsertOnSubmit(invordering); dc.SubmitChanges(); } I don't get any error messages but the record isn't inserted in the database !! Someone who can help me ?

    P 1 Reply Last reply
    0
    • M Mr programboy

      I use the following code in this function : public void VoegNieuwDossierToe(string pDossierNr, int pSectId) { Invordering invordering = new Invordering(); invordering.INVO_DOS_NR = pDossierNr; invordering.INVO_SECT_ID = pSectId; dc.Invorderings.InsertOnSubmit(invordering); dc.SubmitChanges(); } I don't get any error messages but the record isn't inserted in the database !! Someone who can help me ?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Where's your database? Is it included as a local resource in your project? If so, check in the bin directory when the program is running because it will copy over the database into the bin directory at runtime (so any changes won't be made to the one you are running in the solution explorer).

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      My blog | My articles | MoXAML PowerToys

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        Where's your database? Is it included as a local resource in your project? If so, check in the bin directory when the program is running because it will copy over the database into the bin directory at runtime (so any changes won't be made to the one you are running in the solution explorer).

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        My blog | My articles | MoXAML PowerToys

        M Offline
        M Offline
        Mr programboy
        wrote on last edited by
        #3

        My database isn't included as a local resource. I made my database in SQL Server 2005 and then made a dataclass model to work with LINQ. Any idea what the problem can be ?

        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