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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:20:59+00:00 2026-06-09T15:20:59+00:00

Possible Duplicate: How to correctly invoke a function that maps a SProc to ObservableCollection

  • 0

Possible Duplicate:
How to correctly invoke a function that maps a SProc to ObservableCollection in Entity Framework where Objects are of Complex Type

I need to get the output of my stored procedure (which I believe is properly mapped to a complex type ) into an ObservableCollection so that I can bind it to a ListBox using a CollectionViewSource. I don’t know what else to try.

My code now looks EXACTLY like this:

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
          CollectionViewSource GetParts_ResultViewSource = ((CollectionViewSource)(this.FindResource("getParts_ResultViewSource");

          GetPart_ResultViewSource.Source = this.selectedPnsCollection;
     }

     private ObservableCollection<GetParts_Result> selectedPnsCollection = new ObservableCollection<GetParts_Result>();

     private void shapeAttributeLBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
     {
          AttributeView selectedPartShape = this.shapeAttributeLBox.SelectedValue as AttributeView;
           if (shapeAttributeLBox.SelectedValue != null)
           {
                 selectedPnsCollection.Clear();
                 foreach (GetParts_Result result in 
                      this.myEntities.GetParts(selectedPartShape.attributeID, null));
                      {
                          selectedPnsCollection.Add(result);
                      }
              }
       }
      }

However, I’m getting an inner exception that states

 "{"Procedure or function 'GetParts' expects parameter '@@partShape', which was not supplied."}"

But it was supplied…or so I thought…and as an int, which is what my stored procedure expects.


well, what I’m attempting here is to use both the selectedPartShape.attributeID AND null parameters to test my function mapping since my SProc takes two input values, where all are nullable.

Eventually, I’ll use another listbox.SelectedValue property as the second input parameter.

I figured I could just as well manually feed some integer-type IDs just the same (ex: this.myEntities.GetParts(5,161) to return a list of part numbers that each posses attributes with those ids.

  • 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-06-09T15:21:01+00:00Added an answer on June 9, 2026 at 3:21 pm

    Assuming this.myEntities.GetParts(selectedPartShape.attributeID, null) is mapped to the stored procedure, my best guess would say you are getting the error because of the null parameter. Is the AttributeView.attributeId a Nullable<int> or int? field?

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

Sidebar

Related Questions

Possible Duplicate: SmartGWT Dialog title not set correctly I have a problem, is that
Possible Duplicate: Entity Framework Code First: decimal precision I'm using Linq-to-Entities with the EntityFramework
Possible Duplicate: /dev/null in Windows? I have a complex code that encodes input file
Possible Duplicate: How to correctly unregister an event handler MSDN states the following two
Possible Duplicate: Run a code in given time interval I have a method that
Possible Duplicate: Unicode in C++ If I remembered correctly, the default character and string
Possible Duplicate: Space Before Closing Slash? Hi, If I remember correctly we have it
Possible Duplicate: How to get the address of an overloaded member function? I have
Possible Duplicate: C++ virtual function from constructor Calling virtual functions inside constructors This question
Possible Duplicate: Event handlers inside a Javascript loop - need a closure? I have

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.