title: Using stored procedures in C# ASP.NET
body: <p>I have very basic c# knowledge and have not used it in over a year, so I have come up with a small project that I would like to work through. I require some help with the stored procedures however:</p>
  
  <p>I have a table which has already been set up as well as the connection to the DB</p>
  
  <p>Table to store horses:</p>
  
  <pre><code>o   ID
  o   Name(must be unique)
  o   Age (Age can only be 1 - 17)
  o   Member_ID
  </code></pre>
  
  <p>And I would like to perform the following stored procedures-</p>
  
  <p>Create stored procedures to:</p>
  
  <pre><code>o   Insert Horse
  o   Update Horse
  o   Get Horse
  </code></pre>
  
  <p>At the moment this page is still empty:</p>
  
  <p><code>horse.aspx</code>:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Horse.aspx.cs" Inherits="Horse" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;Edit Horse Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Name&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="Name" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Age&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="Age" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;input type="submit" value="Submit" /&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>horse.aspx.cs</code>:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  public partial class Horse : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
  }
  </code></pre>
  
  <p>I was thinking that the best way to display and edit the table would be to use a gridview but was not sure</p>
  
  <p>What I would like to know is how to perform the different actions using the stored procedures</p>
  
  <p>I will appreciate any input and thank you in advance</p>