Hi guys, i'm new to
vb.net. i'm trying to add items in a combo box. check my code
'************************************
For Each xmlNode In gXmlConfig
xmlNode = gXmlConfig.SelectSingleNode("//UPI/Config")
lngId = xmlNode.Attributes("id").InnerText
strName = xmlNode.Attributes("Name").InnerText
Dim objProd As New ProductType(CType(lngId, Long), strName)
cmbProductType.Items.Add(New ProductType(strName, CType(lngId, Long)))
Next
*************************************
ProductType is the class that i've created. i'm adding the objects of this class in the combo box. each time i get "NullReferenceException" runtime error.
Error: System.NullReferenceException: Object reference not set to an instance of an object.
can any body pls help out on this one? i dont know why i'm getting this error.