从SQL2008数据库读取XML数据 [英] Reading an XML data from SQL2008 database

查看:133
本文介绍了从SQL2008数据库读取XML数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想请你帮忙.我有一个SQL2008数据库,其中有一个带有两列的表"tblA".一个是"PID"(用于PrID),另一个是"XMlCol",其中保存了XML文档.我希望将包含XML信息的每一行都解析为一个数据网格,当我单击每个PID时,一个子窗体将显示附加到该数据网格的相对XML.你们能在VB.Net中说些什么如何实现吗?我为您的紧急答复祈祷...谢谢大家.

解决方案

您可以将XML作为字符串从数据库中读取,然后可以在代码中将其解析为大家好,这是我第一次将XML应用于数据库行,我进行了很长的尝试来弄清楚如何处理它.在克里斯蒂安的帮助下,我设法使用字符串并填充了网格.除了他的帮助,我还找到了这篇很棒的文章,它确实真的很有帮助.我想它也会帮助其他人.该文章由Venu Gopal撰写,(http://technico.qnownow.com/2012/06/19/how-save-xml-data-database/)也感谢Christian和CodeProject.


Hi guys,

I wanted to ask you for your assistance. I have an SQL2008 database within which there is a table "tblA" with two columns. One is "PID" (for PrID)and the other is "XMlCol", in which XML document is saved. I wanted each row with the XML info, to parsed to a datagrid, and when i click each PID, a subform will display the relative XML attached to a datagrid. Can you guys please say something in VB.Net how this can be accomplished. I pray for your urgent reply...thank you guys.

解决方案

You can read the XML as a string from your DB, then you can parse it in code to turn it in to the data you need.


hi guys, this was my first encounter with XML into a database row and i had a long trials figuring out how it can be handled. With Christian''s help i managed to use strings and populate a grid. In addition to his help i found this great article, and it really really really helped. I guess it will help other too. The Article is written by Venu Gopal,(http://technico.qnownow.com/2012/06/19/how-save-xml-data-database/) thank you Christian and CodeProject as well.


这篇关于从SQL2008数据库读取XML数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆