This may be a pretty fundamental problem with the way I wrote this, but I need help: I ββhave an uncertainty defined as an open class with two fields, both lines
Public Class mp Dim _fg As String Dim _scode As String Property fg As String Get Return _fg End Get Set(ByVal value As String) _fg = value End Set End Property Property scode As String Get Return _scode End Get Set(ByVal value As String) _scode = value End Set End PropertyEnd Class
Then I define an array of them:
Dim mps As New List(Of mp)()
Then in the loop, I start adding to the list after itβs first cleared:
Dim mpholder As New mp cmd.CommandText = 'Query here cmd.ExecuteNonQuery() reader = cmd.ExecuteReader mp.Clear() Try Do While reader.Read() mpholder.fg = "" mpholder.scode = "" mpholder.fg = reader(0) mpholder.scode = reader(1) mps.Add(mpholder) Loop Catch ex As Exception MP_Res.Text = "error" End Try
If at some stage I get an error and get a catch, the "mp" list has the same number of entries, but they are all empty
source share