title: Object must implement IConvertible using ASP.NET
body: <p>i'm experiencing this error called Object must implement IConvertible.
  please help me! 
  i think it is because of the drop down list for user type. even if i delete / comment out the drop down list i am still experiencing this error.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  using System.Data;
  using System.Data.SqlClient;
  
  public partial class Admin_Register : System.Web.UI.Page
  {
      SqlConnection con = new SqlConnection(Helper.GetCon());
  
      protected void Page_Load(object sender, EventArgs e)
      {
              GetUserTypes();
  
      }
  
      void GetUserTypes()
      {
          con.Open();
          SqlCommand cmd = new SqlCommand();
          cmd.Connection = con;
          cmd.CommandText = "SELECT TypeID, TypeName FROM UserTypes";
          SqlDataReader data = cmd.ExecuteReader();
          ddlUserTypes.DataSource = data;
          ddlUserTypes.DataTextField = "TypeName";
          ddlUserTypes.DataValueField = "TypeID";
          ddlUserTypes.DataBind();
          con.Close();
      }
  
      bool IsRecordExisting(string email)
      {
          bool existing = true;
          con.Open();
          SqlCommand cmd = new SqlCommand();
          cmd.Connection = con;
          cmd.CommandText = "SELECT EmailAddress FROM Users WHERE EmailAddress=@EmailAddress";
          cmd.Parameters.Add("@EmailAddress", SqlDbType.VarChar).Value = email;
          SqlDataReader data = cmd.ExecuteReader();
          if (data.HasRows)
              existing = true;
          else
              existing = false;
          con.Close();
          return existing;
      }
  
  
      protected void btnRegister_Click(object sender, EventArgs e)
      {
          if (!IsRecordExisting(txtEmail.Text))
          {
              con.Open();
              SqlCommand cmd = new SqlCommand();
              cmd.Connection = con;
              cmd.CommandText = "INSERT INTO Users VALUES (@EmailAddress, @Password, @TypeID, @FirstName, @LastName, @MiddleInitial, @Address, @TelNo, @CelNo, @Status";
              cmd.Parameters.Add("@EmailAddress", SqlDbType.VarChar).Value = txtEmail.Text;
              cmd.Parameters.Add("@Password", SqlDbType.VarChar).Value = Helper.CreateSHAHash(txtPassword.Text);
  
              cmd.Parameters.Add("@TypeID", SqlDbType.Int).Value = ddlUserTypes.SelectedValue;
              cmd.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = txtFN;
              cmd.Parameters.Add("@LastName", SqlDbType.VarChar).Value = txtLN;
              cmd.Parameters.Add("@MiddleInitial", SqlDbType.VarChar).Value = "";
              cmd.Parameters.Add("@Address", SqlDbType.VarChar).Value = "";
              cmd.Parameters.Add("@TelNo", SqlDbType.VarChar).Value = "";
              cmd.Parameters.Add("@CelNo", SqlDbType.VarChar).Value = "";
              cmd.Parameters.Add("@Status", SqlDbType.VarChar).Value = "Active";
              cmd.ExecuteNonQuery();
              con.Close();
              Helper.Log("0", "Register", "User Registration");
              Helper.ClearTextboxes(this.Controls);
              register.Visible = true;
          }
          else
          {
              register.Visible = false;
              error.Visible = true;
          }
      }
  }
  </code></pre>