title: stored Procedure usage in ASP.NET
body: <p>I am using <code>StoredProcedure</code> in sqlserver 2005.</p>
  
  <p><strong>Stored Procedure:</strong></p>
  
  <pre><code>create proc useGetASP @PartyCode nvarchar(50)
  as
  select * 
  from partyRegister 
  where PartyCode=@PartyCode
  Go
  </code></pre>
  
  <p>I was trying to execute it with asp.net visual studio 2010.</p>
  
  <p>By researching for code i came to know i should use</p>
  
  <pre><code> cmd.CommandType = CommandType.StoredProcedure
  </code></pre>
  
  <p>But unfortunatly CommandType.StoredProcedure is not there , its not working.</p>
  
  <p>Hence i used:</p>
  
  <pre><code>cmd.CommandType = SqlDataSourceCommandType.StoredProcedure;
  </code></pre>
  
  <p>But this is also not working. It shows me red line below it [As comes when we type something invalid].
  As a tooltip it shows me error as: <code>CommandType does not exists in current context</code></p>
  
  <p><strong>My Full Code:</strong></p>
  
  <pre><code>con.Open();
  cmd = new SqlCommand("useGetASP",con);
  //cmd.CommandType =CommandType./*Not Working*/
  cmd.CommandType = SqlDataSourceCommandType.StoredProcedure;/*Also Not Working*/
  cmd.Parameters.AddWithValue("@PartyCode","0L036");
  </code></pre>
  
  <p>What is my mistake?</p>
  
  <p>What command should i use for implementing stored procedure?</p>
  
  <p>Please Help Me.</p>