Error when does not select data from DDL
<p>I had this message </p>

<blockquote>
  <p><em>Input string was not in a correct format</em> </p>
</blockquote>

<p>when inserting values into the database. When I checked I have DDL but I did not select value from it so this message appeared, although I make this column in the database to allow NULL value.</p>

<pre><code>protected void BT_submit_Click(object sender, ImageClickEventArgs e)
{
    string File = "~/CvFiles/" + FU_CV.FileName;
    if (FU_CV.FileBytes.Length &gt; 4194304)
    {
        modalpopup.Show();
    }
    else
    {
        app.AddApplicant(txt_Mname.Text, Convert.ToInt32(DDL_Dept.SelectedValue));
    }
}

private void loadDepts()
{
    DDL_Dept.DataSource = d.GetAll();
    DDL_Dept.Items.Clear();
    DDL_Dept.AppendDataBoundItems = true;
    DDL_Dept.Items.Insert(0, new ListItem("-All-", "NULL"));
    DDL_Dept.DataValueField = "id";
    DDL_Dept.DataTextField = "name";
    DDL_Dept.DataBind();
}
 public bool AddApplicant(string MiddleName, int Dept_ID)
{

    SqlCommand cmd = new SqlCommand("SP_Insert_IntoApplicantforuser");
    cmd.CommandType = CommandType.StoredProcedure;

    cmd.Parameters.AddWithValue("@MiddleName", MiddleName);


    cmd.Parameters.AddWithValue("@Dept_ID", Dept_ID);


    System.Data.SqlClient.SqlParameter paramter1 = cmd.Parameters.Add("@AppID", SqlDbType.Int);
    paramter1.Direction = ParameterDirection.Output;

    bool rowaffected;
    rowaffected = DBHelper.Instance().Insert(cmd);
    if (rowaffected == false)
    {
        AppID = (int)paramter1.Value;

    }
    return rowaffected;


}
</code></pre>
