Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 667951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:59:09+00:00 2026-05-13T23:59:09+00:00

So I have a stored procedure called Spr_EventLogCreate defined in my database. I have

  • 0

So I have a stored procedure called Spr_EventLogCreate defined in my database. I have created a function import in my data model called LogEvent with no return type, and I can see this function in the Model Browser tree at

MyModel.edmx > MyModel > EntityContainer > Function Imports > LogEvent.

I thought I should then be able to call the function in my code as follows:

var context = new MyModelEntities();
context.LogEvent(...);

But the LogEvent() method is not present.

I must be being really stupid here, but how do I call my imported function?

Using VS 2008 and EF 3.5.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:59:09+00:00Added an answer on May 13, 2026 at 11:59 pm

    There is no way to generate the code calling the function not retuning a result set from design time in default Microsoft designer. You can write code calling it manually in the partial definition of your context class.
    Here is an example:

    
            public void EmpDelete (global::System.Nullable PEMPNO, global::System.Nullable PDEPTNO)
            {
                if (this.Connection.State != System.Data.ConnectionState.Open)
                  this.Connection.Open();
                System.Data.EntityClient.EntityCommand command = new System.Data.EntityClient.EntityCommand();
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = @"DataSourceModel1Entities.EmpDelete";
                command.Connection = (System.Data.EntityClient.EntityConnection)this.Connection;
                EntityParameter PEMPNOParameter = new EntityParameter("PEMPNO", System.Data.DbType.Decimal);
                if (PEMPNO.HasValue)
                    PEMPNOParameter.Value = PEMPNO;
                command.Parameters.Add(PEMPNOParameter);
                EntityParameter PDEPTNOParameter = new EntityParameter("PDEPTNO", System.Data.DbType.Decimal);
                if (PDEPTNO.HasValue)
                    PDEPTNOParameter.Value = PDEPTNO;
                command.Parameters.Add(PDEPTNOParameter);
                command.ExecuteNonQuery();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure which accepts a User defined table type called SeasonTable
I have a stored procedure called WEB_SEL_SECURITY_QUESTIONS in my sql database which returns a
I have a stored procedure called logger(message), where message is of type varchar2. When
I have a stored procedure that is called by data collection system . The
I have a Function called dbo.GetFoo(). I also have a unit-testing Stored Procedure called
I have a stored procedure which is called inside a trigger on Insert/Update/Delete. The
I have a somewhat-long-running stored procedure being called from a PB application. I want
I'd like to have NHibernate call a stored procedure when ISession.Get is called to
I have stored procedure in my database and i need to look up a
I have a stored procedure in oracle which is using cursor.Its fetching the data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.