Groups | Blog | Home
all groups > asp.net webcontrols > june 2003 >

asp.net webcontrols : preparing xml file!


Volkan Karaboða
6/30/2003 5:58:26 PM
Hi all...

I have a problem while trying to prepare an xml file
I have a function like below

Public Function readxml() As XmlDocument()
Dim doc As New XmlDocument()
doc.Load("c:\deneme.xml")
Return doc
End Function

when I call this function like below I recieve an error at the row indicated
with(!!) couldy tell me please where the my foult is??
thanks...

Private Sub b_giris_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles b_giris.Click

Dim xx As New localhost.Service1()
Dim doc As New System.Xml.XmlDocument()
Dim doldu As Boolean = xx.preparaxml()
If doldu = True Then
!!doc = CType(xx.readxml, System.Xml.XmlDocument)
doc.Save("c:\deneme1.xml")
end if
End Sub

Joe Agster
7/1/2003 8:48:46 PM
My best guess is that you need to remove the parenthesis
from the XmlDocument return type specifier

Old:
Public Function readxml() As XmlDocument()

New:
Public Function readxml() As XmlDocument

Your way assumes that the function will return an array
of XmlDocuments.

[quoted text, click to view]
Volkan Karaboga
7/2/2003 2:15:55 PM
hi... again first thanks your advice I tried what you said but it doesnt
resolve my problem. same error goes on.
thanks...


[quoted text, click to view]

AddThis Social Bookmark Button