将数据发送到asp.net中的特殊xml架构 [英] send data to a special xml schema in asp.net

查看:63
本文介绍了将数据发送到asp.net中的特殊xml架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好;



我的XML Schema是这样的:



 <? xml version =   1.0  encoding =   UTF-8  ?>  
< 信件 xmlns = http:/ /www.irica.com/ECE/1383-12/SendSchema\">
< ; 协议 名称 < span class =code-keyword> = ECE 版sion = 1.01 / >
< 软件 SoftwareDeveloper = 来自sql的数据 版本 = 3.0 GUID = A62E7B29-3AE3-4E13-B15E-5E7E10247726 / >
< 发件人 组织 = 来自sql的数据 代码 = A62E7B29-3AE3-4E13-B15E-5E7E10247726 部门 < span class =code-keyword> = Position = 名称 = / >
< Receiver 组织 = 来自sql的数据 代码 = 100003083 ReceiveType = Origin Department = 职位 = 名称 = / >
< < span class =code-leadattribute> LetterNo > 来自sql的数据< < span class =code-leadattribute> / LetterNo >
< LetterDateTime ShowAs = gregorian > 2010-01-18T08:21 :40.0000000 + 03:30 < / LetterDateTime >
< 主题 > ; 来自sql的数据< / Subject >
< 优先级 名称 = عادي 代码 = 1 / >





我有以下数据:

 软件 
SoftwareDeveloper:;
版本:;

发件人
Organization =;


LetterNo =:





如何将这些数据发送到asp中的xml?

解决方案

有不同的方法可以做到这一点。



*创建一个类型 DataSet 反映XML结构。

在Visual Studio中使用数据集 [ ^ ]

如果在Visual Studio中加载XML文件,则可以使用XML菜单自动创建DataSet。



*您可以使用XML LINQ。

XDocument Class [ ^ ]

如果您浏览类 XDocument XElement XAttribute 等你会在MSDN中找到很多例子。



当然你需要创建一个SQL查询才能获得来自数据库的数据。

在不知道表格结构的情况下,我能给出的唯一帮助是: SQL教程 [ ^ ]

Hi every body;

my XML Schema is like this :

<?xml version="1.0" encoding="UTF-8"?>
<Letter xmlns="http://www.irica.com/ECE/1383-12/SendSchema">
  <Protocol Name="ECE" Version="1.01"/>
<Software SoftwareDeveloper="data from sql" Version="3.0" GUID="A62E7B29-3AE3-4E13-B15E-5E7E10247726" />
  <Sender Organization="data from sql" Code="A62E7B29-3AE3-4E13-B15E-5E7E10247726" Department="" Position="" Name=""/>
  <Receiver Organization="data from sql" Code="100003083" ReceiveType="Origin" Department="" Position="" Name=""/>
  <LetterNo>data from sql</LetterNo>
  <LetterDateTime ShowAs="gregorian">2010-01-18T08:21:40.0000000+03:30</LetterDateTime>
  <Subject>data from sql</Subject>
  <Priority Name="عادي" Code="1"/>



and I have these data for ex:

Software
SoftwareDeveloper:"";
Version:"";
.
Sender
Organization="";
.
.
LetterNo="":



how can I send these data to that xml in asp?

解决方案

There are different ways you can do this.

* Create a typed DataSet that reflects the XML structure.
Working with Datasets in Visual Studio[^]
If you load the XML file in Visual Studio, you can auto create a DataSet using the XML menu.

* You can use XML LINQ.
XDocument Class[^]
If you explore the classes XDocument, XElement, XAttribute etc. you will find many examples in MSDN.

Then of course you need to create an SQL query in order to get the data from the database.
Without knowing the structure of your tables, the only help I can give is this: SQL Tutorial[^]


这篇关于将数据发送到asp.net中的特殊xml架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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