Your List should probably be instantiated in the constructor or when first accessed. It hasn't been instantiated therefore the NullRef Exception.
On Sep 23, 6:35 pm, Andrew <[EMAIL PROTECTED]> wrote: > Hi, Im new to VB.net and am running into a small problem. > > I've created the following structure > > Public Structure convertedCodes > Dim code As String > Dim field As List(Of String) > End Structure > > and I try to create an instance as follows: > > Dim temp As New convertedCodes > temp.code = oldc.code > temp.field.Add(oldc.field) > > and it crashes horribly! > > I get "Object reference not set to an instance of an object.", so I am > assuming there is a real problem with creating lists in a structure, > and anyone who could offer assistance, or a better approach would make > my day. > > Cheers! > -Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
