Advertisement

09.18.2008 at 02:15PM PDT, ID: 23744048
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Create XML file from dataset

Asked by gogetsome in .NET

Tags:

Hello, I'm using the following code to create an XML file from a dataset. The file is created but the formatting is not what I need. How can I get my XML file to look like this:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<gallery timer="5" order="random" fadetime="2" looping="yes" xpos="0" ypos="0">
   <image path="Images/one.jpg" />
   <image path="Images/two.jpg" />
   <image path="Images/three.jpg" />
   <image path="Images/four.jpg" />
   <image path="Images/five.jpg" />
</gallery>


WITH THE CODE BELOW it comes out like this:

<?xml version="1.0" standalone="yes"?>
<gallery>
  <path path="Photos/one.jpg" />
  <path path="Photos/two.jpg" />
  <path path="Photos/three.jpg" />
  <path path="Photos/four.jpg" />
  <path path="Photos/five.jpg" />
</gallery>


SO naturally it does not work:


How can I modify my code below to obtain the first xml example???


 Try
                Dim objConn As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("SBD").ToString)

                Dim objDS As New DataSet
                '<gallery timer="5" order="random" fadetime="2" looping="yes" xpos="0" ypos="0">
                objDS.DataSetName = "gallery"

                Dim objaCmd As SqlCommand = New SqlCommand("Meyers_Get_HomePagePhotos", objConn)
                objaCmd.CommandType = CommandType.StoredProcedure
                Dim objaDA As New SqlDataAdapter(objaCmd)

                objConn.Open()

                objaDA.Fill(objDS, "path")

                objConn.Close()

                Dim path As DataColumn
                For Each path In objDS.Tables("path").Columns
                    path.ColumnMapping = MappingType.Attribute
                Next
                objDS.WriteXml(Server.MapPath("Images.xml"), XmlWriteMode.IgnoreSchema)
            Catch ex As SqlException
                lblMessage.Text = ex.ToString()
            End Try
Start Free Trial
[+][-]09.18.2008 at 03:52PM PDT, ID: 22516289

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.18.2008 at 03:56PM PDT, ID: 22516306

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 06:33AM PDT, ID: 22520874

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 06:48AM PDT, ID: 22521006

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 08:49AM PDT, ID: 22522462

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 08:53AM PDT, ID: 22522513

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 08:54AM PDT, ID: 22522527

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 08:57AM PDT, ID: 22522581

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 09:00AM PDT, ID: 22522613

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 09:11AM PDT, ID: 22522725

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.19.2008 at 09:20AM PDT, ID: 22522825

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: asp.net, xml
Sign Up Now!
Solution Provided By: mwvisa1
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628