VS2005 XML Data Storage And Typed-DataSets

mafrosis

Well-known member
Joined
Jun 5, 2006
Messages
88
Location
UK
Programming Experience
5-10
Hello all,

I wrote an app using VS2003 which persists all its data (not that much) to XML locally on the harddrive. I did this by creating an XSD schema which described my data and can then be created as a typed dataset ie,

VB.NET:
<xs:element name="favs">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="name" type="xs:string" />
            <xs:element name="url" type="xs:string" />
        </xs:sequence>
    </xs:complexType>
</xs:element>
My typed dataset can then read in my stored XML:

VB.NET:
reader = New Xml.XmlTextReader(New StreamReader(path))
dsTypedDataSet = New TypedDataSet()
dsTypedDataSet.ReadXml(reader)
And write it back out after ive messed with it via datagrids and binding:

VB.NET:
dsTypedDataSet.WriteXml(path)
Now, ive moved onto VS2005 and im having real trouble recreating the mechanism. I can define my schema ok, and then VS2005 starts treating it as a 'DataSet' file, which is fine - but my 'DataSet' has no methods!! When I look in the .vb code file for the dataset it is empty - in good old 2003, I had a a load of studio generated code..

Has anyone else had this problem / know where im going wrong??

Thanks
mafro :confused:
 
Last edited:
Just looking at some imported code from 2003 - it shows my XSD files as schemas still (prob because the msdata:IsDataSet="true" is missing) but the typed dataset (which is auto-generated) still exists.

And further than that, the code inside the dataset has this attribute, showing that .NET 2.0 has done the compilation:

VB.NET:
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")


Hmmm
 
Back
Top