How to run stored procedure from code behind
<p>i am inserting some values in my table and at the same time, i want to call stored procedure that does some updates but i am having some issues with the syntax.  I have searched online but could not find anything. I am just trying to figure out how can to use the same connection.  here is my code:</p>

<pre><code>sqlcmd.CommandText = "INSERT INTO MyTable(ID, Name ) VALUES(@ID, @Name)";
sqlcmd.Parameters.Clear();
sqlcmd.Parameters.Add("@ID", SqlDbType.VarChar).Value = ID;
sqlcmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = Name;

sqlcmd.Connection = sqlcon;


sqlcmd.ExecuteNonQuery();
</code></pre>

<p>i saw some example on the internet but was not able to figure out how to use the same connection.
here is the example i found:</p>

<pre><code>SqlCommand myCMD = new SqlCommand("sp_Test", sqlcon);
myCMD.CommandType = CommandType.StoredProcedure;
</code></pre>
