Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NETC#4.0
Hi,
 
I have a 2 types of datatables one is total data to be stored this is bind to my grid this is my parent datatable. And another one is child datatable , this having some data imported from my parent datatable this is stored in my viewstate.
What is my problem is when i try to bind my parent datatable to my grid it showing some error message . I don't no what's that error exactly.
 
protected void gdDocument_ItemDataBound(object sender, DataGridItemEventArgs e)
{
   if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
   {
 
     string Doc_Id = ((Label)e.Item.FindControl("lblDrawing")).Text;
     DataTable dtDrawing = ViewState["dtDrawing"] as DataTable;
     DataRow[] drs=dtDrawing.Select("Dwg_No="+Doc_Id);   
   }
}
 
server error.
Min (20) must be less than or equal to max (-1) in a Range object. 
can any one help me to resolve this issue.
Posted 14-Dec-12 0:40am


1 solution

if your Doc_Id is a string then you should use the following line of code
 

DataRow[] drs=dtDrawing.Select("Dwg_No='"+Doc_Id+"'"); 
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 6,824
1 Prasad_Kulkarni 3,671
2 _Amy 3,312
3 OriginalGriff 3,309
4 CPallini 2,925


Advertise | Privacy | Mobile
Web02 | 2.6.130617.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid