Dim sql As String = "Select ProductID From OrderDetail Order By ProductID Desc"
Dim command As New SqlCommand(sql, connection)
Dim reader1 As SqlDataReader = command.ExecuteReader()
How do i store all the productid that i have retrieve into an array?
EDIT : But, Instead of return an Array, i Would return a Generic List of Integers (if you only want to return the ProductId) or A List of
ProductClassobjectsEDIT 2 : As per the comment,
To retrieve an put in the Text of a label, you can do this
Assuming
Label1is theI D of your label control.TheString.Joinmethod will return a string of ProductId’s seperated by comma like"1,2,6,7"