c# - Calling stored procedure entity framework dynamic result set using complex type -
c# - Calling stored procedure entity framework dynamic result set using complex type -
i've stored proc calls view 100 columns stored proc called set of columns user want's view , returns selected columns.
entity framework cannot handle because complex type defined expects 100 columns.
let's phone call stored proc 'personname, personcity' possible other 98 types defined in complex type set null?
you can't utilize entity framework this. should utilize ado.net , datatable calling sp , inspecting returned info structure. this:
var cmd = new sqlcommand("spname", db); cmd.commandtype=commandtype.storedprocedure; cmd.parameters.addwithvalue("@columnnames", "a,b,c"); var da = new sqldataadapter(cmd); datatable dt = new datatable(); da.fill(dt);
foreach (datacolumn dc in dt.columns) { //now have info results columns }
c# sql-server entity-framework
Comments
Post a Comment