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 137881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:10:34+00:00 2026-05-11T07:10:34+00:00

I am having a problem determining how c# and LINQ solve the common problem

  • 0

I am having a problem determining how c# and LINQ solve the common problem of handling a data structure that does not necessarily return a table structure, but instead a resultset.

I have a stored procedure that works, and have included it in my DBML

[Function(Name='dbo.p_GetObject')] public int p_GetObject([Parameter(Name='ObjectType', DbType='NVarChar(200)')] string objectType, [Parameter(Name='ItemState', DbType='Bit')] System.Nullable<bool> itemState, [Parameter(Name='IsPublished', DbType='Bit')] System.Nullable<bool> isPublished) {     IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), objectType, itemState, isPublished);     return ((int)(result.ReturnValue)); } 

The dbml says that the return type is (None) and this could be the crux issue. However I don’t have a DBML object that matches the resultset.

The SP takes three parameters, and returns a result set with three columns (ID, Name, Value) with multple rows. I can create a data object for this, and call it resultSet

When I write a function call for this, I get stuck:

public List<resultset> GetObject(string objectType, bool itemState, bool isPublished) {     MyDataContext.p_GetObject(objectType, itemState, isPublished); } 

My questions are:

how do I have the data context call to the stored procedure populate my resultSet object? Is there a better approach? What should the return type be? A SQL view? Looking for good suggestions…

  • 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. 2026-05-11T07:10:35+00:00Added an answer on May 11, 2026 at 7:10 am

    If it simply isn’t understanding your SP, that could be the SET FMT_ONLY issue… try generating the data from a simplified version of the SP?

    Normally, SPs / UDFs that don’t map 1:1 with an existing entity would expose themselves in a generated type. You can rename this in the DBML file (not in the designer), but personally I wouldn’t; I tend to mark the SP as private, and write my own method that projects into my own POCO type (defined for the repository):

    var typed = from row in cxt.SomeFunction(123)             select new MyType {Id = row.Id, Name = row.Name, ...} 

    The reason for this is partly for repository purity, and partly to guard against the designer’s habit of re-writing the DBML in unexpected ways ;-p See here for more.

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

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer We use wildcarded imports in the modules to allow other… May 11, 2026 at 3:50 pm
  • added an answer update sorry, I misread the question. Still, I think the… May 11, 2026 at 3:50 pm
  • added an answer LINQ-to-SQL's stored procedure implementations will still return your entity objects;… May 11, 2026 at 3:50 pm

Related Questions

I am having a problem with the speed of accessing an association property with
I am having a problem with FCKeditor reverting html entities entered in the source
I am having a problem getting a list of fields from a query defined
I am having a problem using the Unity Application Block, I have created a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.