outofrangeexception

Adding Parent and Child Nodes in TreeView from Sql Server 2008

不打扰是莪最后的温柔 提交于 2019-12-11 01:01:12
问题 i want to add the parent and child nodes from sql server to treeview. i implemented some code. but i gets error "Index was out of range" below is the code i am using to fill parent and child nodes. protected void GetParentNodes() { SqlDataAdapter adap = new SqlDataAdapter("select id, name from crossarticle_category where parentid=-1", con); DataTable dt = new DataTable(); adap.Fill(dt); int index = -1; foreach (DataRow d in dt.Rows) { SqlDataAdapter adapInner = new SqlDataAdapter("select id,

Prevent NSRangeException in subarrayWithRange

匆匆过客 提交于 2019-12-02 01:42:01
I have this code which allows me to pass in an index, and selectively retrieve, a number of images in an array for a certain range length - depending on orientation. When in portrait the range should be be 20 items per index, and i have 43 items altogether. However when i pass in the last index, i get an out of range exception for index 59 beyond bounds of [0..42]. NSArray *tempArray = [self imageData]; UIDeviceOrientation devOr = [[UIDevice currentDevice] orientation]; int kItemsPerView; if (UIDeviceOrientationIsPortrait(devOr)) { kItemsPerView = 20; }else { kItemsPerView = 14; } NSRange

BIGINT Out-of-range Error since MySQL 5.5

邮差的信 提交于 2019-11-29 14:06:11
I'm working with nested sets for my CMS but since MySQL 5.5 I can't move a node. The following error gets thrown: Error while reordering docs:Error in MySQL-DB: Invalid SQL: SELECT baum2.id AS id, COUNT(*) AS level FROM elisabeth_tree AS baum1, elisabeth_tree AS baum2 WHERE baum2.lft BETWEEN baum1.lft AND baum1.rgt GROUP BY baum2.lft ORDER BY ABS(baum2.id - 6); error: BIGINT UNSIGNED value is out of range in '( lektoren . baum2 . id - 6)' error number: 1690 Has anyone solved this Problem? I already tried to cast some parts but it wasn't successful. Ben BIGINT UNSIGNED is unsigned and cannot be

ArgumentOutOfRangeException on initialized List

随声附和 提交于 2019-11-26 23:18:05
It's throwing an ArgumentOutOfRangeException in the middle of the For loop, please note that I cut out the rest of the for loop for (int i = 0; i < CurrentUser.Course_ID.Count - 1; i++) { CurrentUser.Course[i].Course_ID = CurrentUser.Course_ID[i]; } The Code for Course is public class Course { public string Name; public int Grade; public string Course_ID; public List<string> Direct_Assoc; public List<string> InDirect_Assoc; public string Teacher_ID; public string STUTeacher_ID; public string Type; public string Curent_Unit; public string Period; public string Room_Number; public List<Unit>

ArgumentOutOfRangeException on initialized List

痴心易碎 提交于 2019-11-26 08:37:52
问题 It\'s throwing an ArgumentOutOfRangeException in the middle of the For loop, please note that I cut out the rest of the for loop for (int i = 0; i < CurrentUser.Course_ID.Count - 1; i++) { CurrentUser.Course[i].Course_ID = CurrentUser.Course_ID[i]; } The Code for Course is public class Course { public string Name; public int Grade; public string Course_ID; public List<string> Direct_Assoc; public List<string> InDirect_Assoc; public string Teacher_ID; public string STUTeacher_ID; public string