preparing xml file!

V

Volkan Karaboða

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
 
J

Joe Agster

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.
 
V

Volkan Karaboga

hi... again first thanks your advice I tried what you said but it doesnt
resolve my problem. same error goes on.
thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top