Отвечено Problem with stored procedure

  • 7. dubna 2012 18:55
     
      Obsahuje kód

    Hi every body!

    Im using this stored procedure in my proyect silverlight:

    CREATE PROCEDURE Seleccionar
    @ced varchar(50)
    AS BEGIN
    SELECT PROVEEDOR.[Descripcion] AS Descri,[Id_profesional]
    ,[Cedula]
    ,[Primer_nombre]
    ,[Segundo_nombre]
    ,[Primer_apellido]
    ,[Segundo_apellido]
    ,[Telefono_fijo]
    ,[Telefono_movil]
    ,[Direccion_casa]
    ,[Direccion_trabajo]
    ,[Pais]
    ,[Departamento]
    ,[Ciudad]
    ,[Codigo_postal]
    ,[Calificacion_profesional]
    ,[Intereses_profesionales]
    ,[Fecha_nacimiento]
    ,[Sexo]
    ,[Email]
    ,PROFESIONAL.[Proveedor_id]
    ,[Fecha_ingreso]
    ,[Fecha_retiro]
    ,[Estado]
    ,[Estado_civil]
    ,[RH]
    ,[Ubicacion]
    FROM PROFESIONAL INNER JOIN
    PROVEEDOR ON PROFESIONAL.Proveedor_id=PROVEEDOR.Proveedor_id WHERE cedula=@Ced
    END
    
    
    the problem is that im fulling a datagrid with that but the this stored procedured did not return the camp 
    PROVEEDOR.Descripcion AS Descri. when it use this in SQLSERVER works perfect but when use that in the proyect my datagrid doesnt have this camp.
    THx for atention!

Všechny reakce

  • 8. dubna 2012 10:17
    Moderátor
     
     Odpovědět

    hi,

    you say that, in SSMS, the result is correct... that probably means that the problem is your application code in the binding section... to check that, try inspecting the datatable/dataview you filled with the command object to see that it actually contains the "Descri" column...

    regards


    http://www.asql.biz - DbaMgr2k - DbaMgr and further SQL Tools http://www.hotelsole.com/


  • 8. dubna 2012 11:16
     
      Obsahuje kód

    Hi every body!

    Im using this stored procedure in my proyect silverlight:

    CREATE PROCEDURE Seleccionar
    @ced varchar(50)
    AS BEGIN
    SELECT PROVEEDOR.[Descripcion] AS Descri,[Id_profesional]
    ,[Cedula]
    ,[Primer_nombre]
    ,[Segundo_nombre]
    ,[Primer_apellido]
    ,[Segundo_apellido]
    ,[Telefono_fijo]
    ,[Telefono_movil]
    ,[Direccion_casa]
    ,[Direccion_trabajo]
    ,[Pais]
    ,[Departamento]
    ,[Ciudad]
    ,[Codigo_postal]
    ,[Calificacion_profesional]
    ,[Intereses_profesionales]
    ,[Fecha_nacimiento]
    ,[Sexo]
    ,[Email]
    ,PROFESIONAL.[Proveedor_id]
    ,[Fecha_ingreso]
    ,[Fecha_retiro]
    ,[Estado]
    ,[Estado_civil]
    ,[RH]
    ,[Ubicacion]
    FROM PROFESIONAL INNER JOIN
    PROVEEDOR ON PROFESIONAL.Proveedor_id=PROVEEDOR.Proveedor_id WHERE cedula=@Ced
    END
    
    
    the problem is that im fulling a datagrid with that but the this stored procedured did not return the camp 
    PROVEEDOR.Descripcion AS Descri. when it use this in SQLSERVER works perfect but when use that in the proyect my datagrid doesnt have this camp.
    THx for atention!

    why should this stored procedure return the camp ? it is not listed in the SELECT clause and therefore the stored proc can only return the columns listed in the select clause.

    You've two option

    1) change the stored procedure such that the select statement such that column camp is listened

    2) create another stored proc which determine the same result but it includes an additional colum for the value of camp.

    if you provide us more information we may able to help you more.

  • 8. dubna 2012 22:38
    Moderátor
     
     

    hi,

    >why should this stored procedure return the camp ? it is not listed in the SELECT clause and therefore the stored proc can only return the columns listed in the select clause.

    I do think that "camp" stands for "field" or better "column" [or even better "attribute :)]

    and it referes to "PROVEEDOR.Descripcion AS Descri" of the select list..

    regards


    http://www.asql.biz - DbaMgr2k - DbaMgr and further SQL Tools http://www.hotelsole.com/

  • 16. dubna 2012 16:08
     
     

    hi,

    i would sugest you to post it also on silverlight forum.

    http://forums.silverlight.net/