protected void DataListViewPreviosData_ItemDataBound(object sender, DataListItemEventArgs e)
{
try
{
//Fill the grid by finding the Gridveiw Control.
GridView gvSpecDetails = (GridView)e.Item.FindControl("grdViewPreviosData");
TextBox txtSerialNumber = (TextBox)e.Item.FindControl("txtSerialNumber");
index++;
DataTable PartInfoDatadt = (DataTable)Session["PartInfoData"];
//decalre variable for importing data.
DataTable dtNew = PartInfoDatadt.Clone();
DataRow[] drows = PartInfoDatadt.Select("SERIAL_NUM='" + txtSerialNumber.Text + "'");
foreach (DataRow dr in drows)
dtNew.ImportRow(dr);
//checking for null refence.
if (gvSpecDetails != null && txtSerialNumber != null)
{
//if list count > 0 then bind data.
if (dtNew.Rows.Count > 0)
{
gvSpecDetails.DataSource = dtNew;
Session["dtNew"] = dtNew;
gvSpecDetails.DataBind();
}
}
// for testing purpuse.
lblTotal.Text = index.ToString();
}
catch (Exception ex)
{
ApplicationLog.WriteInfo(ex.Message, "ViewPreviousData.DataListViewPreviosData_ItemDataBound()", UserId);
}
}
in above code at the place
DataTable dtNew = PartInfoDatadt.Clone();
DataRow[] drows = PartInfoDatadt.Select("SERIAL_NUM='" + txtSerialNumber.Text + "'");
foreach (DataRow dr in drows)
dtNew.ImportRow(dr);
if serial number contains more than 1000 records i am getting slow response. Any one can help me regarding this.