Newbie - SQL Server and Export XML

R

Ranginald

Hi!

I have a SQL Server view that ends with a FOR XML EXPLICIT command --
problem: I know more about databases than C#!

1. How would I go about writing a C# method that would take the XML
results of this view, and use a save as dialog box to save it to a
file.

Even better, I'd love to be able to generate the XML file,
automatically add appropriate line breaks and tab out the hierarchy,
and then save the file.

2. For whatever it's worth, the end goal is to be able to update the
..XML file for an ASP.NET 2.0 tree control for a web site. I figure
that when the pages change (dynamically generated from SQL Server DB)
-- which is NOT often, I would just run the program from Question #1
above to re-export and reformat the XML file from the view, and then
copy that file to the server for the tree navigation web control. Is
this the correct way to approach this overall issue?


Thanks in advance!
Ranginald
 
M

Michael Nemtsev

Hello Ranginald,

R> Hi!
R>
R> I have a SQL Server view that ends with a FOR XML EXPLICIT command --
R> problem: I know more about databases than C#!
R>
R> 1. How would I go about writing a C# method that would take the XML
R> results of this view, and use a save as dialog box to save it to a
R> file.

Data controls have methods LoadXmlSchema, LoadXml that allow you bind you
xml data to the controls.

R> Even better, I'd love to be able to generate the XML file,
R> automatically add appropriate line breaks and tab out the hierarchy,
R> and then save the file.

..WriteXml accordingly

R> 2. For whatever it's worth, the end goal is to be able to update the
R> .XML file for an ASP.NET 2.0 tree control for a web site. I figure
R> that when the pages change (dynamically generated from SQL Server DB)

ASP.NET 2.0 has XmlDataSource. Read it about in MSDN, it's that u do need

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top