1
Answer

ccanot convert type char

Manu xaml

Manu xaml

15y
6.6k
1

I am passing a number value differentItems[2].Trim() which I then pass to delete a record.

I get an error on the first line: Cannot convert type Char


foreach (Corrections cor in correctionsManager.DeleteCorrectionsForInspection(differentItems[2].Trim()));


CorrectionsManager.cs
        public string DeleteCorrectionsForInspection(string correctionID)
    
        {
            string returnGroup = "";
            try
            {
                //Create the Parameter collection
                IDataParameter[] paramCollection = new IDataParameter[1];
                OleDbParameter p_correctionID = new OleDbParameter("CorrectionID", correctionID);
                paramCollection[0] = p_correctionID;

                returnGroup = db.ExecuteScalar(DELETE_CORRECTIONS_FOR_JOB, CommandType.Text, paramCollection).ToString();

                return returnGroup;
            }

            catch (Exception ex)
            {
                //Indicates error condition
                Logger.CustomLog.LoggingEventError(ex.Message, ex);
                return returnGroup;
            }
        }



Corrections.cs
        public int CorrectionID
        {
            get
            {
                return correctionID;
            }
            set
            {
                correctionID = value;
            }
        }
Answers (1)