Sunday, 15 September 2013

mysql - db.Database.SqlQuery raw data returns stored procedure name and parameters -


I have a stored procedure that gives a string in 1 row and 1 column.

I'm using this method to see and return the string as db.Database to the SqlQuery method. However, when I check the return value, it gives the name and parameter of the stored procedure that I am attempting to pass.

  var val = db.Database.SqlQuery & lt; String & gt; (String.Format "{0} @QuestionnaireID", model.ObjectiveB.StoredProcedure.SpName), new SQL parametor ("questionnaire", model.product ID));  

This is what is back

 Enter the image details here </ p> <pre> <code>. FirstOfDefault () </ code> </ pre> <p> and </ p> <pre> <code> .list () </ Code> </ pre> <p> But still do not return any values ​​that I want, any help of OLL and its parameters in the name of stored functioning will be great! </ P> </ div> <P> <div class =

Simple answer is something like this:

  var response = db. database base ULF. & Lt; string & gt; ("EXEC procName @ p1 = {0}, @ p2 = {1}, @ p3 = {2}", v1, v2, v3); Var strResponse = resp.First ();  

Be sure to check the response objects for the first errors.


No comments:

Post a Comment