PC Review


Reply
Thread Tools Rate Thread

[C#] Index was outside the bounds of the array

 
 
Bj?rn Scheepers via .NET 247
Guest
Posts: n/a
 
      13th May 2004
I'm struggling with this error for a while now.
First I'll give a shot description of what I'm doing.

I got 2 DataGrids on a webform.
1 with existing task for 1 day, and 1 that gets filled in by using a method FindFreeHours.
It's in that FindFreeHours method that i get a IndexOutOfRangeException.

FindFreeHours() searches for gaps in the task list of that day.
When it gets called for the second time, i get the error at aantal = 0 (aantal = number of).
When i comment the "aantal = 0" the error just moves to the next line.

Some code:

public void FindFreeHours()
{
DataRow dr1;
DataRow dr2;
aantal = 0;
...
}

The BindGrid() method that get's called every time befor the FindFreeHours
private void BindGrid()
{
dsCodfus = cfs.getCfData("5",huidigeDatum.ToShortDateString());
Application["dsCodfus"] = dsCodfus;
grid1.DataSource = dsCodfus.Tables[0].DefaultView;
grid1.DataBind();
}

This code comes from the Page_Load() method. It isn't in the !ispostback part because every action on the form needs an update of the dataset (a webmethod returns the tasks of @user, for @date).

I realy hope somebody could help me out here

--------------------------------
From: Bj?rn Scheepers

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>j0tgjFaHa0SRuZqy5QCflw==</Id>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array index out of bounds Cnewman65 Microsoft Outlook 1 22nd May 2009 01:35 PM
Index was outside the bounds of the array =?Utf-8?B?Q2FtbWllIFdhdHNvbg==?= Microsoft ASP .NET 3 28th Nov 2005 05:53 PM
index was outside the bounds of the array =?Utf-8?B?ZGVubmlzdDY4NQ==?= Microsoft Access Database Table Design 1 15th Sep 2005 09:02 AM
index out of bounds of the array ? Geoff Cox Microsoft C# .NET 13 11th Aug 2005 04:18 PM
Array index out of bounds Neil Microsoft Outlook BCM 3 5th Aug 2004 09:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:39 AM.