shah Momin

shah Momin

  • NA
  • 176
  • 21.7k

Cannot implicitly convert type 'decimal' to 'string'

Jun 2 2022 6:28 PM
private void ApplicationSettings_Load(object sender, EventArgs e)
{
    AppBLL appBLL = new AppBLL();
    if (isApplicationSettings)
        return;
    DataSet applicationSettings = appBLL.GetApplicationSettings();
    DataRow[] dataRowArray1 = applicationSettings.Tables[0].Select("groupsettingname = 'BestDutyReport'");
    for (int index = 0; index < dataRowArray1.Length; ++index)
    {
        if (dataRowArray1[index]["settingname"].ToString() == "SlideSize")
            ddlBestDutySlideSize.Text = dataRowArray1[index]["settingvalue"].ToString();
        else if (dataRowArray1[index]["settingname"].ToString() == "VolunteerPerSlide")
           (numBestDutyVolPerSlide.Value) = (Decimal)int.Parse(dataRowArray1[index]["settingvalue"].ToString());
        else if (dataRowArray1[index]["settingname"].ToString() == "VideoTimePerSlide")
            numBestDutyVideoTimePerSlide.Value = (Decimal)int.Parse(dataRowArray1[index]["settingvalue"].ToString());
    }
    DataRow[] dataRowArray2 = applicationSettings.Tables[0].Select("groupsettingname = 'MonthlyReport'");
    for (int index = 0; index < dataRowArray2.Length; ++index)
    {
        if (dataRowArray2[index]["settingname"].ToString() == "SlideSize")
            ddlMonthlySlideSize.Text = dataRowArray2[index]["settingvalue"].ToString();
        else if (dataRowArray2[index]["settingname"].ToString() == "VolunteerPerSlide")
            numMonthlyVolPerSlide.Text = (Decimal)int.Parse(dataRowArray2[index]["settingvalue"].ToString());
        else if (dataRowArray2[index]["settingname"].ToString() == "VideoTimePerSlide")
            numMonthlyVideoTimePerSlide.Value = (Decimal)int.Parse(dataRowArray2[index]["settingvalue"].ToString());
    }
    isApplicationSettings = true;
}

LineNumber 13,15,23,25


Answers (4)