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
Abhilash J A
530
2.4k
601k
error - add list items to the static class variable C#
Dec 22 2016 8:56 AM
I want to get list listview items in the static class. Because I want to pass this class variable to another class. So I have tried...
public
static
class
FileMngUserID
{
public
static
List<
int
> UserId;
public
static
List<
string
> ImgName;
}
foreach (DocumentsUser item
in
listView1.SelectedItems)
{
FileMngUserID.UserId.Add(Convert.ToInt32(item.UserId));
FileMngUserID.ImgName.Add(item.Parent_File_Name);
}
but here
FileMngUserID.UserId.Add(Convert.ToInt32(item.UserId));
occurring error '
Object reference not set to an instance of an object.
'
Reply
Answers (
5
)
how to do databinding between more XML files for TreeView
what outer loop and inner loop represent in bubble sort