M
multisync
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.WebControls.ListItem)': Value of type 'Admin.clsSites'
cannot be converted to 'System.Web.UI.WebControls.ListItem'
This is my code:
Public Sub LoadSites()
'Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
'cboSites.BeginUpdate()
Dim xDoc As New XmlDocument
xDoc.Load(Server.MapPath("\config.sites.xml"))
Dim xNodelist As XmlNodeList =
xDoc.SelectNodes("/sitedata/site")
For Each xNode As XmlNode In xNodelist
Dim Site As New clsSites
Site.Name = xNode.Attributes.GetNamedItem("name").Value
Site.Server = xNode.ChildNodes.Item(0).InnerText
Me.cboSites.Items.Add(Site) <---ERROR HERE
Next
cboSites.EndUpdate()
Cursor.Current = System.Windows.Forms.Cursors.Default
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.WebControls.ListItem)': Value of type 'Admin.clsSites'
cannot be converted to 'System.Web.UI.WebControls.ListItem'
This is my code:
Public Sub LoadSites()
'Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
'cboSites.BeginUpdate()
Dim xDoc As New XmlDocument
xDoc.Load(Server.MapPath("\config.sites.xml"))
Dim xNodelist As XmlNodeList =
xDoc.SelectNodes("/sitedata/site")
For Each xNode As XmlNode In xNodelist
Dim Site As New clsSites
Site.Name = xNode.Attributes.GetNamedItem("name").Value
Site.Server = xNode.ChildNodes.Item(0).InnerText
Me.cboSites.Items.Add(Site) <---ERROR HERE
Next
cboSites.EndUpdate()
Cursor.Current = System.Windows.Forms.Cursors.Default
End Sub
Anyone know how to fix this?