Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / September 2006

Tip: Looking for answers? Try searching our database.

Location of file written by WriteXML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
glenn - 15 Sep 2006 16:15 GMT
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
Cowboy (Gregory A. Beamer) - 15 Sep 2006 16:20 GMT
WriteXmlSchema writes out the DataSet definition. WriteXml writes out the
actual data.

To write out to a web directory, you should MapPath to get root and then add
that part of the path to your document name. I am not completely sure where
it would save the document if you simply call write with a file name only.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************

> Hello,
>
[quoted text clipped - 33 lines]
>
> - Glenn
glenn - 15 Sep 2006 16:48 GMT
Gregory,

That did the trick.  Sorry for the simple question.  Guess I was just having
a senior moment.

- Glenn

> WriteXmlSchema writes out the DataSet definition. WriteXml writes out the
> actual data.
[quoted text clipped - 40 lines]
> >
> > - Glenn

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.