Sql sever wirdest error ever : The C# code:

      SqlConnection c;
            string str = "Data Source =(LocalDB)\\MSSQLLocalDB;";
            str += "AttachDbFilename=|DataDirectory|\\DinoData.mdf;";
            str += "Integrated Security= True";
            c = new SqlConnection(str);
            if (Session["Conect"] != null)
            {
                if ((bool)Session["Conect"])
                {
                    logdiv.Visible = false;
                    Usernamec.InnerHtml = (string)Session["CurentUserid"];
                    Connected.Visible = true;
                    SqlCommand exp = new SqlCommand("SELECT xp FROM[User] Where Username = @username", c);
                    exp.Parameters.AddWithValue("@username", (string)Session["CurentUserid"]);
                    c.Open();
                    Session["exp"] = exp.ExecuteReader();
                    c.Close();
                    int b = (int)Session["exp"] / 2;
                    string a = b + "px";
                    xp.Style.Add("width", ((string)Session["exp"])+"%");
                }
                else
                {
            

        Connected.Visible = false;
                logdiv.Visible = true;
            }
        }

The Error:

> An exception of type 'System.InvalidCastException' occurred in
> App_Web_ump4h2pq.dll but was not handled in user code
> 
> Additional information: Specified cast is not valid.