Groups | Blog | Home
all groups > dotnet xml > september 2004 >

dotnet xml : selecting XML from SQL2000 and using it in ASP.NET


Don
9/9/2004 5:50:38 PM
I am running this in SQL Server 2000:
SELECT lastname, firstname, title, hiredate
FROM employees
FOR XML AUTO

I get back these results in the Query Analyzer:
<employees lastname="Jones" firstname="James" title="Developer"
hiredate="2004-05-10T00:00:00"/><employees lastname="Jordan" firstname="Ken"
title="Sr. Developer" hiredate="2004-05-03T00:00:00"/>

But in a webform, when I call the ExecuteXMLReader and do a Response.Write
white looping through the reader, I only get back the first node.

Any reason for this? It doesn't make any sense.

My intention in all this is to select SQL DATA in XML, Deserialize the XML
into a class, Manipulate and instance of that class, and send the resulting
XML back into the Database to commit the changes. If you have done this,
please point me to some resources.

Thanks,

Do

Jared
9/10/2004 9:55:14 PM
Don,
Since you are moving the data back into the database, why don't you just
use a dataset, or datatable object and a dataadapter. You can make the
changes and then you only need to call the update method on the dataadapter.
What is the purpose of using the "for xml auto" syntax in flat table?
Jared


[quoted text, click to view]

AddThis Social Bookmark Button