Edit a SQL Server 2005 XML column in ASP.NET

  • Thread starter Greg Collins [Microsoft MVP]
  • Start date
G

Greg Collins [Microsoft MVP]

Hi. I've been trying to figure this out for a couple weeks now and have posted various pleas for help, but so far I've not been able to find the magic I need to make this happen. This can't be too uncommon of a scenario. Certainly someone has done this before.

What I'm trying to do is the following:

1. Pull XML from an MS SQL Server 2005 XML column.
2. Load it into a DataSet (unless there's a better way).
3. Bind it to some ASP.NET control(s) for editing.
4. Allow user to editing of the data in the web page.
5. Get the updated data from the control(s) as XML
6. Post it back to the SQL XML column.

I can do 1-4 above... but for the life of me can't get step 5 to work.

Does someone have a simple bare-bones example of the above 6 steps actually working that they can post for me to examine/review?
 
P

Petar Atanasov

Greg said:
Hi. I've been trying to figure this out for a couple weeks now and have posted various pleas for help, but so far I've not been able to find the magic I need to make this happen. This can't be too uncommon of a scenario. Certainly someone has done this before.

What I'm trying to do is the following:

1. Pull XML from an MS SQL Server 2005 XML column.
2. Load it into a DataSet (unless there's a better way).
3. Bind it to some ASP.NET control(s) for editing.
4. Allow user to editing of the data in the web page.
5. Get the updated data from the control(s) as XML
6. Post it back to the SQL XML column.

I can do 1-4 above... but for the life of me can't get step 5 to work.

Does someone have a simple bare-bones example of the above 6 steps actually working that they can post for me to examine/review?

Hi, Greg
check out this:
http://msdn2.microsoft.com/en-us/library/58a18dwa.aspx

What's exactly your case - you need to serialize the whole dataset,
or a given column ?

Regards,
Petar Atanasov
http://a-wake.net
 
T

TheSQLGuru

Use a table for the values on the form instead of XML? :))

--
TheSQLGuru
President
Indicium Resources, Inc.

"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Hi. I've been trying to figure this out for a couple weeks now and have
posted various pleas for help, but so far I've not been able to find the
magic I need to make this happen. This can't be too uncommon of a scenario.
Certainly someone has done this before.

What I'm trying to do is the following:

1. Pull XML from an MS SQL Server 2005 XML column.
2. Load it into a DataSet (unless there's a better way).
3. Bind it to some ASP.NET control(s) for editing.
4. Allow user to editing of the data in the web page.
5. Get the updated data from the control(s) as XML
6. Post it back to the SQL XML column.

I can do 1-4 above... but for the life of me can't get step 5 to work.

Does someone have a simple bare-bones example of the above 6 steps actually
working that they can post for me to examine/review?
 
K

KJ

What about using the WriteXml method of the DataSet after the changes are
made to it? Does that do anything useful?

"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Hi. I've been trying to figure this out for a couple weeks now and have
posted various pleas for help, but so far I've not been able to find the
magic I need to make this happen. This can't be too uncommon of a scenario.
Certainly someone has done this before.

What I'm trying to do is the following:

1. Pull XML from an MS SQL Server 2005 XML column.
2. Load it into a DataSet (unless there's a better way).
3. Bind it to some ASP.NET control(s) for editing.
4. Allow user to editing of the data in the web page.
5. Get the updated data from the control(s) as XML
6. Post it back to the SQL XML column.

I can do 1-4 above... but for the life of me can't get step 5 to work.

Does someone have a simple bare-bones example of the above 6 steps actually
working that they can post for me to examine/review?
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top