Procedures stored in Controller Entity framework

0

I have a stored procedure that edits a record, the date field is with getdate() , I'm trying to use that procedure in my controller but I get an error.

  

No argument corresponding to the formal parameter has been given   required

and I think it might have something to do with the date

[HttpPost]                                                                      
   public ActionResult Edit (double id, FormCollection collection) 
     try{                                                                     
       testsp usr =db.spelegirid(id).First();                                           
       if(ModelState.IsValid){
   db.insertproceso(id,collection["id,material,proceso,encargado,fechafinal"]); 
     }
    
asked by senseilex 23.06.2017 в 17:17
source

1 answer

0

If you add or remove arguments in a SQL stored procedure previously added to your model in your project, you must delete their references and update your model again (add the SP again)

Open project data model

Remove stored procedure model (It must be removed from the 3 containers indicated, in complex types, usually add a '_Result' to the name of your SP)

Re-add your SP to the model

Do these steps and let me know how you are doing;)

Breakpoint VS

The breakpoint or point of interruption serves to take a trace of what your code does, is very useful when you want to check if a step is running correctly, as shown in the following photo, you can place a point where you want to pause the execution (Red arrow). When executing, the execution will be paused where you indicated the point, with the mouse you can check the values of the variables.

  • with F5 you resume the execution
  • with F10 you advance to the next line
  • F11 allows you to advance or enter within a function or routine (as long as there is one in the line of execution in which you are)
  • answered by 23.06.2017 / 17:40
    source