I am trying to store an image to an Image list of a button control as:
Button btn = new Button();
btn.ImageList.Images.Add("image1", dbClass.Image1[0]); // ERROR
btn.ImageList.Images.Add("image2", dbClass.Image2[0]);
Where dbClass.Image1[0]
is an image, but the code show this exception Object reference not set to an instance of an object.
What I am doing wrong here?