Hello Experts,
Below Code Is Showing Data From Different Dates. In Json Format.
How Can I Check That Data IS Not Available On Today's Date - Means The Json Is Blank On Any Date. IT Will Give Error Message That Data Is Not Available.
private void GetDataFromJSON()
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
string strToken = Authenticate.Auth(string.Empty, string.Empty);
string strrequesturl = $"http://210.255.200.204:804/api/Voucher/GetVoucherByDate?Date_From={txt_SearchByDateFrom.Text}&Date_To={txt_SearchByDateTo.Text}";
string data = CommonFacade.ExecuteGET(strrequesturl, strToken);
string json = data;
gv_Details.DataSource = JsonConvert.DeserializeObject<DataTable>(json);
DataTable dt = gv_Details.DataSource as DataTable;
gv_Details.DataBind();
gv_Details.FooterRow.Cells[7].HorizontalAlign = HorizontalAlign.Center;
gv_Details.FooterRow.Cells[7].Text = Convert.ToDecimal(dt.Compute("Sum(Amount)", "")).ToString("N2");
lbl_ErrorMessage.Text = "";
lblTotalRecords.Text = "" + (gv_Details.DataSource as DataTable).Rows.Count;
}