Manu xaml

Manu xaml

  • NA
  • 19
  • 0

ccanot convert type char

Apr 17 2009 1:51 PM

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)