使用ADO.net将XML插入数据库 [英] Inserting XML into Database with ADO.net

查看:63
本文介绍了使用ADO.net将XML插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说有一种方法可以获取相应模式的XML字符串,并使用它将数据添加到数据库中。例如:

< myTable>
< field1> 1< / field1>
< field2> stuff< / field2>
< / myTable>

将匹配我的数据库中的表,我可以简单地使用该xml而不是和sql字符串来插入一行。

这可能吗?如果有的话,有人可以发布一些示例代码来告诉我该怎么做吗?

I've heard there is a way to take an XML string of the appropriate schema and use it to add data to a database.   For instance:

<myTable>
   <field1>1</field1>
   <field2>stuff</field2>
</myTable>

would match to a table in my database, and I could simply use that xml instead of and sql string to insert a row. 

Is this possible?  and if so, can someone post some sample code to show me how to do it?

推荐答案

这是你要找的吗?

将XML格式的数据插入SQL Server

这篇关于使用ADO.net将XML插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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