none
MVC C# calling a stored procedure and creating a datatable RRS feed

  • Question

  • Hi,

    I want to call a stored procedure in and display values in a table.

    I created a model for ado connection and have access to all my stored procedures, I can populate a dropdown ok but not sure how to populate a table.

    My code for dropdown:

    Controller:
    
    DBEntites db = new DBEntites();
    
            public ActionResult Index( )
    	{
    	   CircuitClass  model  = new CircuitClass();
    	   model.MyCircuit = 
               db.getMyCircuits(DateTime.Today);
    	   return View( model );
    	}
    Model:
    
      public class CircuitClass
      {
         public IEnumerable<getMyCircuits_Result> MyCircuit
         {get;set;}
      }
    View:
    
        Circuit: @Html.DropDownListFor(x => x.MyCircuit, new SelectList(Model.MyCircuit, "Name", "Name"), "Select Circuit")

    How do I make a table for my other stored procedures?

    Thanks for your help.


    CuriousCoder




    • Edited by CuriousCoder15 Wednesday, April 17, 2019 2:34 PM
    • Moved by CoolDadTx Wednesday, April 17, 2019 2:35 PM ASP.NET related
    Wednesday, April 17, 2019 2:27 PM

All replies