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 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 am trying to call a scalar UDF in SQL Server from the entity
Im trying to call all users from a database with the same interests as
I'm trying to call SendMessage with an uint parameter from Java, but I can't
I'm trying to call a web service from Excel 2003 module. The way i've
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
I trying to call some ejb bean method from tread. and getting error :
Im trying to call python functions from C code, and i followed a sample
I am trying to call a inherited method that must access private attributes from
I am trying to call the GetConsoleScreenBufferInfoEx function from a console application. If it
I'm trying to call a user-defined MATLAB function from a C application, but I'm

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.