Covert nvarchar to int :   // https://www.codeproject.com/Questions/823002/How-to-clear-Request-Querystring
            string url = context.Request.Url.AbsoluteUri; // Henter URL
            string[] separateURL = url.Split('?'); // Splitter URL
            NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString(separateURL[0]); // Parameterne
            string categoryId = queryString[0];  // Indeks 0 er categoryId

            StringBuilder table = new StringBuilder();

            con.Open();

            SqlCommand cmd = new SqlCommand("uspPasteDataSubCategories", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@categoryid", categoryId);

            SqlDataReader rd = cmd.ExecuteReader();

Recieving the error: System.Data.SqlClient.SqlException: 'Error converting data type nvarchar to int.'
which doesn't make sense for me because the datatype is not nvarchar in the database.
Error happens at:
SqlDataReader rd = cmd.ExecuteReader();