using stored procedures in Entity Data model as functions

Last post 04-06-2009 7:02 AM by lucky1983. 7 replies.

Sort Posts:

  • using stored procedures in Entity Data model as functions

    04-02-2009, 5:03 AM
    • Member
      50 point Member
    • lucky1983
    • Member since 06-28-2007, 12:11 AM
    • India
    • Posts 38

    Hi,

    I m trying to build a web site which will use ENTITY DATA MODEL for database interactions. I have added some stored procedures to the entity model. But I can only access those stored procedures which returns entity set. All other SPs which return "scalar" or "none" are not accessible in the code.

     This procedure was simple and straight forward in LINQ to SQL. Where we could access all the stored procedures (irrespective of return type) directly in our code behind as methods.

    Can we extend the entity classes to expose those SPs to the code behind. Or is there any other solution?

     

    Please help !!

    "Its nothing to die.....
    but its terrible to not to live"
  • Re: using stored procedures in Entity Data model as functions

    04-02-2009, 5:12 AM

    lucky1983:

     I have added some stored procedures to the entity model. But I can only access those stored procedures which returns entity set. All other SPs which return "scalar" or "none" are not accessible in the code.


     

     

     I think u want to do something like this...

     esUtility e = new esUtility(); 

    object alerts = e.ExecuteScalar("Booking", "spGetHotelAlerts", parameters); 

    return alerts.ToString(); 

    Please mark this post as Answer if it is of help to you!

    " Every wall is a door..! "
  • Re: using stored procedures in Entity Data model as functions

    04-02-2009, 5:55 AM
    • Member
      50 point Member
    • lucky1983
    • Member since 06-28-2007, 12:11 AM
    • India
    • Posts 38

    Hi,

    Thank you for your reply. Actually I know very little about "esUtility". Is this an external utility? (external to microsoft?) I dont have permission to use any third party tool or utility in our project. Can you give some more information about "esUtility".

    Thanks

    Lucky

    "Its nothing to die.....
    but its terrible to not to live"
  • Re: using stored procedures in Entity Data model as functions

    04-02-2009, 6:19 AM

    u said u are using ENTITY DATA MODEL...? let me confirm that u r usinf the entity spaces right? if yes then esUtility is part of it.u have to write using EntitySpaces.Interfaces;
    using EntitySpaces.Core; to access it... wel l let me know if  i can help u in this direction.

    Please mark this post as Answer if it is of help to you!

    " Every wall is a door..! "
  • Re: using stored procedures in Entity Data model as functions

    04-02-2009, 11:49 PM
    • Member
      50 point Member
    • lucky1983
    • Member since 06-28-2007, 12:11 AM
    • India
    • Posts 38

     

    Actually I m using ADO .NET entity data model which is a part of .net framework version 3.5. I guess "esUtility" is a different thing.

    BR

    Lucky

    "Its nothing to die.....
    but its terrible to not to live"
  • Re: using stored procedures in Entity Data model as functions

    04-02-2009, 11:53 PM
    • Member
      50 point Member
    • lucky1983
    • Member since 06-28-2007, 12:11 AM
    • India
    • Posts 38

    Hi,

    Actually I am using ADO .Net Entity Data Model which is a part of .net framework 3.5. I guess it is different than "esUtility".

     

    BR

    Lucky

    "Its nothing to die.....
    but its terrible to not to live"
  • Re: using stored procedures in Entity Data model as functions

    04-06-2009, 2:05 AM
    Answer

    lucky1983:

    Actually I m using ADO .NET entity data model which is a part of .net framework version 3.5. I guess "esUtility" is a different thing.

    BR

    Lucky

    For questions related to ADO.NET Entity Framework and LINQ to Entities, I suggest you to ask them here to get a quicker and better reply.

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: using stored procedures in Entity Data model as functions

    04-06-2009, 7:02 AM
    • Member
      50 point Member
    • lucky1983
    • Member since 06-28-2007, 12:11 AM
    • India
    • Posts 38

    Hey thanks for ur reply. I have posted this topic in the "Ado .net entity framework and linq entities" forum. link for this thread is:

    http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/3f55039c-754c-41db-a116-2c915ebdf41b/

     Hope this problem will solve quickly.

     Thanks,

    Lucky

    "Its nothing to die.....
    but its terrible to not to live"
Page 1 of 1 (8 items)