Thursday, March 29, 2012

Edit a SQL Server 2005 XML column in ASP.NET

Hi. I've been trying to figure this out for a couple ws 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?
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )On 5 23 , 7 40 , "Greg Collins [Microsoft MVP]"
<gcollins_AT_msn_DOT_com> wrote:
> Hi. I've been trying to figure this out for a couple ws now and have posted var
ious 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 th
is
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 actuall
y working that they can post for me to examine/review?
> --
> Greg Collins [Microsoft MVP]
> Visit Braintrove (http://www.braintrove.com)
4. Allow user to editing of the data in the web page.
Here i think we can use javascript DOM to modify xml document
according to user's edit.
5. Get the updated data from the control(s) as XML
And now we can get the xml document of step 4.
6. Post it back to the SQL XML column.
:) here have nothing to consider.
Hope this can help.|||On 5 23 , 7 40 , "Greg Collins [Microsoft MVP]"
<gcollins_AT_msn_DOT_com> wrote:
> Hi. I've been trying to figure this out for a couple ws now and have posted var
ious 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 th
is
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 actuall
y working that they can post for me to examine/review?
> --
> Greg Collins [Microsoft MVP]
> Visit Braintrove (http://www.braintrove.com)
4. Allow user to editing of the data in the web page.
Here i think we can use javascript DOM to modify xml document
according to user's edit.
5. Get the updated data from the control(s) as XML
And now we can get the xml document of step 4.
6. Post it back to the SQL XML column.
:) here have nothing to consider.
Hope this can help.|||On 5 23 , 7 40 , "Greg Collins [Microsoft MVP]"
<gcollins_AT_msn_DOT_com> wrote:
> Hi. I've been trying to figure this out for a couple ws now and have posted var
ious 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 th
is
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 actuall
y working that they can post for me to examine/review?
> --
> Greg Collins [Microsoft MVP]
> Visit Braintrove (http://www.braintrove.com)
4. Allow user to editing of the data in the web page.
Here i think we can use javascript DOM to modify xml document
according to user's edit.
5. Get the updated data from the control(s) as XML
And now we can get the xml document of step 4.
6. Post it back to the SQL XML column.
:) here have nothing to consider.
Hope this can help.|||Greg Collins [Microsoft MVP] wrote:
> Hi. I've been trying to figure this out for a couple ws now and have posted var
ious 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 th
is
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 actuall
y 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
news:ussV38SnHHA.4316@.TK2MSFTNGP06.phx.gbl...
Hi. I've been trying to figure this out for a couple ws 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 Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )|||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
news:ussV38SnHHA.4316@.TK2MSFTNGP06.phx.gbl...
Hi. I've been trying to figure this out for a couple ws 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 Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )

No comments:

Post a Comment