title: "Error converting data type nvarchar to int." executing stored procedure
body: <p>I have a stored procedure and I am getting this error when executing it from C# code.</p>
  
  <blockquote>
    <p>Error converting data type nvarchar to int.</p>
  </blockquote>
  
  <p>My stored procedure:</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[donateBloodProc] 
    @donorName varchar(50),
    @gender varchar(20),
    @email varchar(50),
    @bloodGroup varchar(50),
    @contact_number int, @L_D_D date,
    @city varchar(50),
    @arid_number varchar(50),
    @DepId int 
    AS
    INSERT INTO
          tblDonors(Dname, gender, bloodGroup, email, contact_number,
          L_D_D,city,arid_number,DeptID,dateDonated) 
      VALUES 
         (@donorName,@gender,@bloodGroup,@email,@contact_number,
         @L_D_D,@city,@arid_number,@DepId,GETDATE());
  </code></pre>
  
  <p>And this is my C# code:</p>
  
  <pre><code>SqlCommand commandForSP = new SqlCommand("donateBloodProc",DALobj.openConnection());
  commandForSP.CommandType = System.Data.CommandType.StoredProcedure;
  
  commandForSP.Parameters.AddWithValue("@donorName", TextBox1.Text);
  commandForSP.Parameters.AddWithValue("@gender", RadioButtonList1.SelectedValue);
  commandForSP.Parameters.AddWithValue("@email", TextBox5.Text);
  commandForSP.Parameters.AddWithValue("@bloodGroup", DropDownList1.SelectedValue);
  commandForSP.Parameters.AddWithValue("@contact_number", TextBox2.Text);
  commandForSP.Parameters.AddWithValue("@L_D_D", TextBox3.Text);
  commandForSP.Parameters.AddWithValue("@city", DropDownList2.SelectedValue);
  commandForSP.Parameters.AddWithValue("@arid_number", TextBox1.Text);
  commandForSP.Parameters.AddWithValue("@DepId", TextBox4.Text);
  
  commandForSP.ExecuteNonQuery();
  </code></pre>
  
  <p>All the data types of the columns in my stored procedure are same as in my database table <code>tblDonors</code></p>