Click here to Skip to main content
13,194,617 members (50,461 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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

Rate this: bad
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+"'"); 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171018.2 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2017
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