Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
error - add list items to the static class variable C#
Mani Kandan
Dec 22 2016 8:56 AM
223
Reply
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.
'
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
how to do databinding between more XML files for TreeView
what outer loop and inner loop represent in bubble sort