Hello. Wonder if anyone knows a solution to my little problem.
From a form I populate a dataset using
and getXMLData is a function in a seperate class
When I make another call to a different function (one that writes xml to the file) I am told that the file is in use by another process.
Apparently in .net NOTHING no longer works like it did in VB6.
I've tried messing with finalize() and dispose() but have had no luck.
How do I kill an object? I know its nothing else because I can strip out the code from the writeXML function and put it in the form and it works fine. Its only when I'm creating instances of a class that it tells me its being used by another process at the line which is calling writeXML function.
Thanks if anyone can help.
From a form I populate a dataset using
Code:
Dim obj As New nsMain.clsMain
dsdataset = obj.getXMLData("E:names.xml")
Code:
Public Shared Function getXMLData(loc As String, name As String) As DataSet
Dim dsDataSet As New DataSet(name)
Dim fsReadXml As New System.IO.FileStream (loc, System.IO.FileMode.Open)
Dim myXmlReader As New System.Xml.XmlTextReader(fsReadXml)
dsDataSet.ReadXml(myXmlReader)
myXmlReader.Close()
Return dsDataSet
Exit Function
End Function
When I make another call to a different function (one that writes xml to the file) I am told that the file is in use by another process.
Apparently in .net NOTHING no longer works like it did in VB6.
I've tried messing with finalize() and dispose() but have had no luck.
How do I kill an object? I know its nothing else because I can strip out the code from the writeXML function and put it in the form and it works fine. Its only when I'm creating instances of a class that it tells me its being used by another process at the line which is calling writeXML function.
Thanks if anyone can help.