title: Passing stored procedure parameters in c# .net application
body: <p>I have a stored procedure and I am connecting it to my project and I wanted to know how I can pass the different parameter types in: </p>
  
  <p>Stored procedure:</p>
  
  <pre><code>  [dbo].[UploadAssignment]  
            @studentId int    
      , @guid uniqueidentifier  
      , @originalfilename nvarchar(500)   
      , @uploaddate datetime      
  </code></pre>
  
  <p>In my project:</p>
  
  <pre><code>public virtual IEnumerable&lt;T&gt; GetUploadStudentSubmission&lt;T&gt;(int studentId, .."How should i format the remaining parameters")  
  {  
     SqlCommand _command = new SqlCommand("dbo.UploadAssignment");  
     _command.CommandType = CommandType.StoredProcedure;  
     _command.Parameters.Add(new SqlParameter { ParameterName = "studentId",SqlDbType = SqlDbType.Int, Value = sectionId});  
     _command.Parameters.Add(new SqlParameter { ParameterName = "guid", SqlDbType = SqlDbType.Int, Value = guid });  
     _command.Parameters.Add(new SqlParameter { ParameterName = "originalfilename", SqlDbType = SqlDbType.Int, Value = originalfilename });  
     _command.Parameters.Add(new SqlParameter { ParameterName = "uploaddate", SqlDbType = SqlDbType.Int, Value = uploaddate });
  } 
  </code></pre>