Show results of a Stored Procedure

Asked

Viewed 46 times

1

I want to show the result of the trial in a List

I added it to the model and generated this code.

public virtual ObjectResult<string> SP_ListaDadosCarteiraPGC(Nullable<int> ano, Nullable<int> mes, string codex, string adabas)
    {
        var anoParameter = ano.HasValue ?
            new ObjectParameter("ano", ano) :
            new ObjectParameter("ano", typeof(int));

        var mesParameter = mes.HasValue ?
            new ObjectParameter("mes", mes) :
            new ObjectParameter("mes", typeof(int));

        var codexParameter = codex != null ?
            new ObjectParameter("codex", codex) :
            new ObjectParameter("codex", typeof(string));

        var adabasParameter = adabas != null ?
            new ObjectParameter("adabas", adabas) :
            new ObjectParameter("adabas", typeof(string));

        return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<string>("SP_ListaDadosCarteiraPGC", anoParameter, mesParameter, codexParameter, adabasParameter);
    } 

Now as I recover the return of this trial ?

I tried so more brings only the value 'MG15200531691'

        ObjectResult<string> products = dbmapa.SP_ListaDadosCarteiraPGC(2016, 3, "MG15200531691", null);

        List<string> viewProducts = products.ToList();
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.