Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > i create data list control. In datalist contorl i getting parts for serial numbers .if there are so many serial numbers, the following code is not working
 

i create data list control. In datalist contorl i getting parts for serial numbers .if there are so many serial numbers, the following code is not working








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.

kavya.123  Thursday, August 06, 2009 7:25 AM
Hi kavya.123,

Could you let me know what kind of your application is? This forum only copes with the issues related to WinForm, but your code snippet shows that your application might be of type Asp.Net. If so, please post here: http://forums.asp.net/.

Best regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
  • Marked As Answer bykavya.123 Monday, August 10, 2009 11:36 AM
  •  
Aland Li  Friday, August 07, 2009 9:55 AM








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. any one can help me inabove solution.please
  • Edited bykavya.123 Thursday, August 06, 2009 11:19 AM
  • Edited bykavya.123 Thursday, August 06, 2009 11:13 AM
  •  
kavya.123  Thursday, August 06, 2009 10:58 AM
Hi kavya.123,

Could you let me know what kind of your application is? This forum only copes with the issues related to WinForm, but your code snippet shows that your application might be of type Asp.Net. If so, please post here: http://forums.asp.net/.

Best regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
  • Marked As Answer bykavya.123 Monday, August 10, 2009 11:36 AM
  •  
Aland Li  Friday, August 07, 2009 9:55 AM

You can use google to search for other answers

Custom Search

More Threads

• Multi-Header DataGridView
• Using More the One RowFilter in a Datagrid
• How bound are my controls? Entering new text in a ComboBox does not seem to add a new item
• strange display bug of navigator if main tabpage were select() during form load ...
• Parent datagridview, child and grand-child gridview
• Help with DataSet designer!
• Hi there, can someone help out the help_out_guy1, regarding the "bindingnavigator" ?
• DataView.RowFilter Problem
• Populate combobox with datatable column names
• Syncronize scrolling of 2 dataGridView's in C#