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
Tom
NA
31
0
Using Array.GetLength() ?
Jul 28 2008 10:32 AM
Hi all, i am trying to write a little code that goes through a loop while a count is less than a 2d array's (0th) postion,
here is my code
string[,] Products;
DataRow[] foundRows = myDataTable.Select();
for (int i = 0; i < foundRows.Count(); i++)
{
int thecount = 0;
bool FoundResult = false;
while (thecount <
Products
.GetLength(0))
{
if (Products[i, 0] == foundRows[i][3].ToString())
{
int tempint = int.Parse(Products[thecount, 1].ToString());
tempint++;
Products[thecount, 1] = tempint.ToString();
FoundResult = true;
break;
}
else
{
}
thecount++;
}
This all looks good to me, but when i run the code it throws up the error
"Error 1 Use of unassigned local variable 'Products'
The bit underlined where its happening... any ideas ?
the array needs to be dynamic.. since i add to it as its searching
Thanks in advance..
Reply
Answers (
1
)
Network Interface Configuration - C#
help hiding tray app