TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ram Prasad
NA
326
18.4k
getting ArgumentOutOfRangeException for my custom data type.
Sep 9 2019 7:36 PM
I am getting this error at "get => (JaggedData)jaggeddatas[index];". Please direct me to the right direction towards the solution.
class
JaggedDataCollection
{
ArrayList jaggeddatas =
new
ArrayList();
public
JaggedData
this
[
int
index]
{
get
=> (JaggedData)jaggeddatas[index];
set
=> jaggeddatas.Insert(index, value);
}
}
public
class
NumberWithDifference
{
public
int
Number {
get
;
set
; }
public
static
int
[] decimalNumbers =
new
int
[10]{0,1,2,3,4,5,6,7,8,9};
JaggedDataCollection jdc =
new
JaggedDataCollection();
foreach
(var item
in
jagged.Items)
{
i =
true
;
int
index = 0;
bool
i =
true
;
int
index = 0;
for
(
int
j = 0; j < decimalNumbers.Length; j++)
{
if
(jdc[index].Number == decimalNumbers[j])
{
Console.Write(decimalNumbers[j]);
i =
false
;
if
(index < decimalNumbers.Length - 1)
index++;
}
else
{ Console.Write(0); }
}
}
}
This is the error I am getting "System.ArgumentOutOfRangeException"
Reply
Answers (
2
)
late binding and early binding
Add hyperlink in Excel file using Open XML