I'm getting the following error:
Overload resolution failed because no accessible 'Add' can be called
with these arguments: 'Public Sub Add(item As
System.Web.UI.W ebControls.List Item)': Value of type 'Admin.clsSites '
cannot be converted to 'System.Web.UI. WebControls.Lis tItem'
This is my code:
Public Sub LoadSites()
'Cursor.Current = System.Windows. Forms.Cursors.W aitCursor
'cboSites.Begin Update()
Dim xDoc As New XmlDocument
xDoc.Load(Serve r.MapPath("\con fig.sites.xml") )
Dim xNodelist As XmlNodeList =
xDoc.SelectNode s("/sitedata/site")
For Each xNode As XmlNode In xNodelist
Dim Site As New clsSites
Site.Name = xNode.Attribute s.GetNamedItem( "name").Val ue
Site.Server = xNode.ChildNode s.Item(0).Inner Text
Me.cboSites.Ite ms.Add(Site) <---ERROR HERE
Next
cboSites.EndUpd ate()
Cursor.Current = System.Windows. Forms.Cursors.D efault
End Sub
Anyone know how to fix this?
Overload resolution failed because no accessible 'Add' can be called
with these arguments: 'Public Sub Add(item As
System.Web.UI.W ebControls.List Item)': Value of type 'Admin.clsSites '
cannot be converted to 'System.Web.UI. WebControls.Lis tItem'
This is my code:
Public Sub LoadSites()
'Cursor.Current = System.Windows. Forms.Cursors.W aitCursor
'cboSites.Begin Update()
Dim xDoc As New XmlDocument
xDoc.Load(Serve r.MapPath("\con fig.sites.xml") )
Dim xNodelist As XmlNodeList =
xDoc.SelectNode s("/sitedata/site")
For Each xNode As XmlNode In xNodelist
Dim Site As New clsSites
Site.Name = xNode.Attribute s.GetNamedItem( "name").Val ue
Site.Server = xNode.ChildNode s.Item(0).Inner Text
Me.cboSites.Ite ms.Add(Site) <---ERROR HERE
Next
cboSites.EndUpd ate()
Cursor.Current = System.Windows. Forms.Cursors.D efault
End Sub
Anyone know how to fix this?
Comment