G
Guest
Hello,
I am using the following code in an attempt to write my dataset to XML.
Function GetRecordCount() as integer
Dim strConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=c:\path\fmdb.mdb"
Dim queryString As String = "SELECT [rfi].* FROM [rfi]"
Dim RcdCount As String
Dim m_XmlFile As String = "myrfi.xml"
Dim m_SchemaFile As String = "myrfi.xsd"
Dim dataAdapter As New OleDbDataAdapter(querystring, strConnString)
Dim dataSet As DataSet = New DataSet()
dataAdapter.Fill(dataSet, "rfi")
dataSet.WriteXmlSchema(m_SchemaFile)
dataSet.WriteXml(m_XmlFile, XmlWriteMode.IgnoreSchema)
RcdCount = dataSet.Tables("rfi").Rows.Count.ToString()
return RcdCount
End Function
The function is called and no errors occur but I cannot find my
new XML file myrfi.xml anywhere on the root directory of my webserver.
Not sure if I even need the call to WriteXmlSchema or not...
What am I missing here?
Thanks in advance for any tips.
- Glenn
I am using the following code in an attempt to write my dataset to XML.
Function GetRecordCount() as integer
Dim strConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; Data Source=c:\path\fmdb.mdb"
Dim queryString As String = "SELECT [rfi].* FROM [rfi]"
Dim RcdCount As String
Dim m_XmlFile As String = "myrfi.xml"
Dim m_SchemaFile As String = "myrfi.xsd"
Dim dataAdapter As New OleDbDataAdapter(querystring, strConnString)
Dim dataSet As DataSet = New DataSet()
dataAdapter.Fill(dataSet, "rfi")
dataSet.WriteXmlSchema(m_SchemaFile)
dataSet.WriteXml(m_XmlFile, XmlWriteMode.IgnoreSchema)
RcdCount = dataSet.Tables("rfi").Rows.Count.ToString()
return RcdCount
End Function
The function is called and no errors occur but I cannot find my
new XML file myrfi.xml anywhere on the root directory of my webserver.
Not sure if I even need the call to WriteXmlSchema or not...
What am I missing here?
Thanks in advance for any tips.
- Glenn