You should use an Arraylist or -better- a generic List(of Product) Besides I would strongly recommend to set Option Strict On in your project's Compiler Settings Dim products As New List(Of Product) While datareaderData.read() Dim nextProduct As New Product nextProduct. ProductID = CType(datareaderData("ID"), System. Int32) nextProduct.Name = datareaderData("Name").
ToString products. Add(nextProduct) End While.
You should use an Arraylist or -better- a generic List(of Product). Besides I would strongly recommend to set Option Strict On in your project's Compiler Settings. Dim products As New List(Of Product) While datareaderData.read() Dim nextProduct As New Product nextProduct.
ProductID = CType(datareaderData("ID"), System. Int32) nextProduct. Name = datareaderData("Name").
ToString products. Add(nextProduct) End While.
In one of my code behind pages, I am retrieving data from an SQL Command and placing the same into a datareader object. How would I be able to declare the class so that each row in my datareader would actually be an instance of the said class? When I do the same, I am getting an error "Object Reference Not Set to an Instance of an Object.
I am quite stumped on this one. Any tips greatly appreciated.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.