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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:11:43+00:00 2026-06-10T06:11:43+00:00

I make stored procedure that select data with condition but the problem is :-

  • 0

I make stored procedure that select data with condition but the problem is :-

when RequiredIDID =2 ( Select come with some data from join table and if not I am not select it in else statement ) and after mapping to linq function this problem appears

if I’m pass requirdID = 2 to function no problem occurs coz the first select in proc executed but if I pass other requirdID ( ex. = 3 ) this message appears

The data reader is incompatible with the specified
‘RealEstateCenterModel.SearchForRealState_Reader’. A member of the
type, ‘FloorTypeCategory’, does not have a corresponding column in the
data reader with the same name.

USE [RealEstateCenter]
GO
/****** Object:  StoredProcedure [dbo].[TestOptionalParameter]    Script Date: 08/23/2012 07:29:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[TestOptionalParameter]
@RequiredIDID int =NULL 
as

if @RequiredIDID=2
begin
SELECT     FloorSpace.SpaceFrom, RealEstateCategoryDetails.RequiredCategoryTypeName, FloorType.FloorTypeCategory, FloorType.FloorNotes, 
                      RealEstateTypes.RequiedType
FROM         PersonalRealStateDetails INNER JOIN
                      FloorSpace ON PersonalRealStateDetails.FloorSpaceID = FloorSpace.FloorSpaceID INNER JOIN
                      RealEstateCategoryDetails ON PersonalRealStateDetails.RequiredCategoryTypeID = RealEstateCategoryDetails.RequiredCategoryTypeID INNER JOIN
                      FloorType ON PersonalRealStateDetails.FloorTypeID = FloorType.FloorTypeID INNER JOIN
                      RealEstateTypes ON RealEstateCategoryDetails.RequiredID = RealEstateTypes.RequiredID

end

else
begin
SELECT     FloorSpace.SpaceFrom, RealEstateCategoryDetails.RequiredCategoryTypeName, RealEstateTypes.RequiedType
FROM         PersonalRealStateDetails INNER JOIN
                      FloorSpace ON PersonalRealStateDetails.FloorSpaceID = FloorSpace.FloorSpaceID INNER JOIN
                      RealEstateCategoryDetails ON PersonalRealStateDetails.RequiredCategoryTypeID = RealEstateCategoryDetails.RequiredCategoryTypeID INNER JOIN
                      RealEstateTypes ON RealEstateCategoryDetails.RequiredID = RealEstateTypes.RequiredID
end

How I can solve this problem?

  • 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-10T06:11:44+00:00Added an answer on June 10, 2026 at 6:11 am

    You could add the missing columns, with some default values, to the second select.

    SELECT FloorSpace.SpaceFrom, RealEstateCategoryDetails.RequiredCategoryTypeName, RealEstateTypes.RequiedType, 0 as [FloorType.FloorTypeCategory], NULL as [FloorType.FloorNotes]
    

    or

    SELECT FloorSpace.SpaceFrom, RealEstateCategoryDetails.RequiredCategoryTypeName, RealEstateTypes.RequiedType, 0 as FloorTypeCategory, NULL as FloorNotes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this stored procedure, that reads data from xml and make some inserts
I want to do following: Make Oracle stored procedure for read all data from
I have a stored procedure in SQL Server that returns some data via a
I have a stored procedure that takes a product_id and returns some data about
I need to make a stored procedure or function that returns a set of
I'm trying to write a stored procedure in SQL that will : Make a
I need to make some changes to an old Oracle stored procedure on an
I have a huge pl/sql stored procedure, where we make some deletions as long
I am trying to make one stored procedure only in SQL Server that lets
I have a stored procedure that is working with a large amount of 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.