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

  • SEARCH
  • Home
  • 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 3284968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:12:51+00:00 2026-05-17T20:12:51+00:00

Am trying to call a UDF which just takes a parameter and returns a

  • 0

Am trying to call a UDF which just takes a parameter and returns a scalar. The examples I’ve seen all use a From clause: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/10/20/calling-user-defined-functions-udfs-in-entity-framework.aspx

But I only want to call the UDF, I don’t want to “join” it with any entities using a from clause:

  string fieldTag = "TagNameHere";
  var sql = "SELECT XyzModel.Store.FieldNameToFormIdMap(@fieldTag)";
  System.Data.Objects.ObjectQuery<int> query =
    new System.Data.Objects.ObjectQuery<int>(sql, xyzEntitiesContext);
  query.Parameters.Add(new System.Data.Objects.ObjectParameter("fieldTag", fieldTag));

I get the error: “The query syntax is not valid.”

This is using .NET 3.5

I could use old style ADO.NET but I’d rather not have to manage another set of connection strings aside from those used for the entity framework.

  • 1 1 Answer
  • 0 Views
  • 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-17T20:12:52+00:00Added an answer on May 17, 2026 at 8:12 pm

    Just remove SELECT from your query, like this:
    var sql = “XyzModel.Store.FieldNameToFormIdMap(@fieldTag)”;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call a web service from Excel 2003 module. The way i've
I am trying to call out to a legacy dll compiled from FORTRAN code.
Trying to call a function from another file in C with the following code:
I am trying to call an ASMX from jQuery using JSON and get a
I am trying to call the function MyMethod from within a object but none
I am trying to call and alert when a button is pressed. i use
I am trying to call native executables from java program. I have three exe
When trying to call Close or Dispose on an SqlDataReader i get a timeout
I'm trying to call an Antlr task in my Ant build.xml as follows: <path
I'm trying to call a function after I load some XML into Actionscript, and

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.