EDN Admin
Well-known member
Hi, I need to get my xml document in the following format:
<electronix><br/>
<br/>
<televisions><br/>
<tv ID="1 <br/>
<title>ice</title><br/>
</tv><br/>
<tv ID="2 <br/>
<title>Sony</title><br/>
</tv><br/>
</televisions><br/>
<br/>
<dvd><br/>
<bluray ID="3 <br/>
<title>Vangelis Portraits</title><br/>
</bluray><br/>
<bluray ID=" <br/>
<title>James Bond</title>
</bluray>
</dvd><br/>
<br/>
//root element<br/>
</electronix>
the code im using to extract the data from the tables is:
public DataTable ShowAllMedia() {<br/>
string query = "Select * FROM televisions, dvd";<br/>
SqlDataAdapter reader = new SqlDataAdapter(query, myConnection);<br/>
DataTable dt = new DataTable();<br/>
reader.Fill(dt);<br/>
return dt;<br/>
}
but it wont show up in that format i need to close the <televisions> before I open the <dvd> tags please help
THANKSSSSSSSSSS
View the full article
<electronix><br/>
<br/>
<televisions><br/>
<tv ID="1 <br/>
<title>ice</title><br/>
</tv><br/>
<tv ID="2 <br/>
<title>Sony</title><br/>
</tv><br/>
</televisions><br/>
<br/>
<dvd><br/>
<bluray ID="3 <br/>
<title>Vangelis Portraits</title><br/>
</bluray><br/>
<bluray ID=" <br/>
<title>James Bond</title>
</bluray>
</dvd><br/>
<br/>
//root element<br/>
</electronix>
the code im using to extract the data from the tables is:
public DataTable ShowAllMedia() {<br/>
string query = "Select * FROM televisions, dvd";<br/>
SqlDataAdapter reader = new SqlDataAdapter(query, myConnection);<br/>
DataTable dt = new DataTable();<br/>
reader.Fill(dt);<br/>
return dt;<br/>
}
but it wont show up in that format i need to close the <televisions> before I open the <dvd> tags please help
THANKSSSSSSSSSS
View the full article