private void FetchSehedule() { txtSchAmount.Text = "0"; txtWeeklyComments.Text = ""; Whitfieldcore wc = new Whitfieldcore(); DataSet ds = new DataSet(); ds = wc.GetScheduleDataForCashFlow(Convert.ToInt32(ViewState["twc_project_number"].ToString()), ddlYear.SelectedItem.Value.ToString(), ddlMonth.SelectedItem.Value.ToString() + "(" + ddlYear.SelectedItem.Value.ToString() + ")", ddlWeek.SelectedItem.Value.ToString()); Int32 resultCount = 0; if (ds.Tables.Count > 0) resultCount = ds.Tables[0].Rows.Count; DataTable myControls; myControls = ds.Tables[0]; if (myControls.Rows.Count > 0) { try { foreach (DataRow dRow in myControls.Rows) { String _comments = dRow["weeklyNotes"] != DBNull.Value ? dRow["weeklyNotes"].ToString() : ""; String project_amount = dRow["project_amount"] != DBNull.Value ? dRow["project_amount"].ToString() : "0"; txtSchAmount.Text = project_amount; txtWeeklyComments.Text = _comments; } } catch (Exception ex) { Response.Write(ex.Message); } DisplaySchedulingGrid(); } else { txtSchAmount.Text = "0"; txtWeeklyComments.Text = ""; } }