将数据从ASP.net传递到XML文件,再将XML文件传递到SQLServer2005 [英] Passing data from ASP.net to XML file and XML file to SQLServer2005

查看:71
本文介绍了将数据从ASP.net传递到XML文件,再将XML文件传递到SQLServer2005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用asp.net Web应用程序遵循以下三轮胎架构.

Asp.net-> Biussness层->数据访问层-> DB

但即使在离线模式下我也必须工作,所以我需要一种功能性
喜欢

Asp.net-> BL->

如果连接打开到数据库,我需要将页面数据保存到XML文件中,然后我必须将此Xml文件推入数据库中.

我们计划使用DOm.有人可以帮我将XML数据发送到每个记录集的数据库中吗?

Hi all,

I am using asp.net web application Present Following 3-tire Architecture.

Asp.net-->Biussness layer--> Data Access layer--> DB

but I have to work even for Offline mode so I need a fuctionality
like

Asp.net -->BL-->

I need to save page data in to XML file if connection open to Data base then I have to push This Xml file into DataBase.

We are planning to use DOm. Can anyone help me in sending XML data into Database For each Recordset?

推荐答案

关注此问题

OPENXML [在ADO.NET中使用OPENXML [
Follow this

OPENXML[^]

Using OPENXML with ADO.NET[^]




在BL和DAL中,您可以根据需要选择dataset/xml.

1.当数据存储在XML文件中时,您可以从xml文件中以xml形式获取数据.因此,您的目标是将此xml数据传递到数据库存储过程.

在SQL Server 2005及更高版本的数据库中,有一个名为"xml"的数据类型.您可以将DAL中的xml数据作为xml数据传递到存储过程.内部存储过程中如何提取数据的信息在这里,

http://weblogs.asp.net/jgalloway/archive/2007/02/16/passing-lists-to-sql-server-2005-with-xml-parameters.aspx


上面的文章非常好,我相信会很有帮助.

另一件事,人们有时将xml数据作为字符串从数据访问传递给存储过程.但是问题是当传递xml数据时,它们是最大数据长度的限制是varchar.因此,最好直接使用xml类型而不是varchar从DAL向存储过程发送数据.

让我知道该帖子是否有帮助.
Hi,

Across BL and DAL you might opt for dataset/xml whatever is as per your requirement.

1. When you have data stored in XML file then you can get the data from xml file as xml. So you have the objective of passing this xml data to database stored procedure.

In database SQL Server 2005 onwards there is datatype called "xml". You can pass the xml data from DAL to stored procedure as xml data. Inside stored procedure how you can extract data is found here,

http://weblogs.asp.net/jgalloway/archive/2007/02/16/passing-lists-to-sql-server-2005-with-xml-parameters.aspx


The above article is very nice and I am sure would be very much helpful.

Another one thing, people sometime passes xml data as a string from data access to stored procedure. But problem is their is restriction of max data length when you pass xml data is varchar. Hence it is better if you directly use type xml instead of varchar for sending data to stored procedure from DAL.

Let me know if the post is helpfull.


这篇关于将数据从ASP.net传递到XML文件,再将XML文件传递到SQLServer2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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