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. Database & SysAdmin
  3. Database
  4. Stored procedures in Entity Framework

Stored procedures in Entity Framework

Scheduled Pinned Locked Moved Database
csharpdatabasedotnetbusinesshelp
4 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.
  • J Offline
    J Offline
    jonatan_556
    wrote on last edited by
    #1

    Hi everyone. First i want to ask apologize for my english but it isn't my mother language. But i try my best to explain myself. second i already post it in the .Net Framework section at Question & Answers label, but Henry Minute said to post it here because. My Problem is: I'm building a project using entity framework. The data base is generate by a edmx(database project). To implement business logic i use stored procedures, but i only con map the to parent entity funcions. I can't map stored procedures to an associated table. Thanks

    A 1 Reply Last reply
    0
    • J jonatan_556

      Hi everyone. First i want to ask apologize for my english but it isn't my mother language. But i try my best to explain myself. second i already post it in the .Net Framework section at Question & Answers label, but Henry Minute said to post it here because. My Problem is: I'm building a project using entity framework. The data base is generate by a edmx(database project). To implement business logic i use stored procedures, but i only con map the to parent entity funcions. I can't map stored procedures to an associated table. Thanks

      A Offline
      A Offline
      Ali Al Omairi Abu AlHassan
      wrote on last edited by
      #2

      give me your sp

      Help people,so poeple can help you.

      J 1 Reply Last reply
      0
      • A Ali Al Omairi Abu AlHassan

        give me your sp

        Help people,so poeple can help you.

        J Offline
        J Offline
        jonatan_556
        wrote on last edited by
        #3

        Hi, the problem is not the sp. The problem is i can't map it. I only can map sp to an Entity(stored procedure mapping) that exists in the .edmx file. Ex: sp_insertClient is mapped to the addClient at mapping functions. But imagine that is another table associted with the Client table by a many-to-many association. The intermediate table beetwen them has no entity in the designer model(.edmx file). So, i can not map a sp to that intermediate table. Best regards

        A 1 Reply Last reply
        0
        • J jonatan_556

          Hi, the problem is not the sp. The problem is i can't map it. I only can map sp to an Entity(stored procedure mapping) that exists in the .edmx file. Ex: sp_insertClient is mapped to the addClient at mapping functions. But imagine that is another table associted with the Client table by a many-to-many association. The intermediate table beetwen them has no entity in the designer model(.edmx file). So, i can not map a sp to that intermediate table. Best regards

          A Offline
          A Offline
          Ali Al Omairi Abu AlHassan
          wrote on last edited by
          #4

          send your data as an xml to the sp as

          SET @Sls_Serial = SCOPE_IDINTITY();

          DECLARE @insptr Int;
          EXEC sp_xml_preparedocument @insptr OUTPUT, @XML;

          INSERT INTO Sales_Head
          SELECT
          @Sls_Serial_No
          -- ,<other columns>
          FROM OPENXML(@insptr,'<element path>',1)
          WITH
          (<column> <type> '@<attribute name>');

          EXEC sp_xml_removedocument @insptr

          Help people,so poeple can help you.

          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