Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#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 1:40am
(unknown member)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
0 OriginalGriff 384
1 Maciej Los 290
2 Sergey Alexandrovich Kryukov 230
3 CPallini 170
4 Shweta N Mishra 165
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100