Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/06/2013, 20:20
Avatar de yetrus
yetrus
 
Fecha de Ingreso: marzo-2006
Mensajes: 252
Antigüedad: 18 años, 1 mes
Puntos: 0
Cargar data desde EntityFramework con SP

Hola Amigos

tengo una duda y no he dado conla solucion

Estoy cargando dos Dropdownslist con Entity Framework desde Procedimitnos Almacenados
este es el error de VS 2010

"El lector de datos es incompatible con el 'SellosetModel.AppComuna' especificado. Un miembro del tipo, 'IdRegion', no tiene una columna correspondiente en el lector de datos con el mismo nombre."






sp 1, que carga las regiones,

Código PHP:
ALTER procedure [dbo].[GetRegion]
(
@
IdRegion int
)
AS
DECLARE @
select varCHAR(100)
DECLARE @
from varCHAR(100)
DECLARE @
where VARCHAR(100)
SET @select  'SELECT [IdRegion] ,[NombreRegion] '
SET @from ' from [AppRegion] ' 
SET @where ' where  1 = 1 '

if (@IdRegion <> 0)
    
BEGIN 
        SET 
@where = @where ' and AppRegion.IdRegion = ' CAST(@IdRegion AS VARCHAR)
    
END     
        SET 
@select = @select + @from + @where
        
--PRINT (@select )
        
EXEC(@select 
SP 2 , que carga las N Comunas de cada region
Código PHP:

ALTER procedure 
[dbo].[GetComunas
(
@
IdRegion int
)
AS

DECLARE @
SQL varCHAR(100)
DECLARE @
from varCHAR(100)
DECLARE @
where VARCHAR(100)

SET @SQL  'SELECT [IdComuna] ,[NombreComuna] '
SET @from ' from [AppComuna] ' 
SET @where ' where  1 = 1 '

if (@IdRegion <> 0)
    
BEGIN 
        SET 
@where = @where ' and AppComuna.IdRegion = ' CAST(@IdRegion AS VARCHAR)
    
END     
        SET 
@SQL = @SQL + @from + @where
    
--    PRINT (@SQL )
        
EXEC(@SQL 
Alguna idea ??
sl2