Edit a SQL Server 2005 XML column in ASP.NET

  • Thread starter Thread starter Greg Collins [Microsoft MVP]
  • Start date 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?
 
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
 
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?
 
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?
 
Back
Top