在创建SQL模式时需要帮助

编程入门 行业动态 更新时间:2024-10-27 07:23:45
本文介绍了在创建SQL模式时需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我下面有一个来自系统的示例数据,

I have below sample data from a system,

表X

Col_Name DataType

Col_Name DataType

系统名称字符串

systemNamestring

SystemVersion十进制

SystemVersionDecimal

SubmitedOn日期时间

SubmitedOn DateTime

现在,我要通过C#中的上述数据在XML下创建

Now, I m creating below XML by above data in C#,

< Source_XML>

<Source_XML>

< SystemName Value =时间表";名称=""/</SystemName>

<SystemName Value="Timesheet" Name=""></SystemName>

< SystemVersion Value ="1.0"名称=""/</SystemVersion>

<SystemVersion Value="1.0" Name=""></SystemVersion>

< SubmitedOn Value ="2010年8月31日";名称="/"/SubmitedOn>

<SubmitedOn Value="08/31/2010" Name=""></SubmitedOn>

</Source_XML>

</Source_XML>

现在,我需要使用C#为上述XML准备XML SCHEMA,并在SQL 2005中进行注册...,这样我们就可以在上述XML上进行验证了.

Now I need to prepare XML SCHEMA for above XML by C# and register the same in SQL 2005...so that nxt time we can validate above XML.

请有人建议我如何实现上述功能....在运行时通过C#创建架构,并将相同的架构注册到SQL 2005数据库中.

Please someone suggest me how to do above functionality....creating schema at runtime by C# and register the same schema into SQL 2005 database.

谢谢

推荐答案

您可以使用executenonquery创建表.

You can use the executenonquery to create a table.

这是显示如何创建表的行.

Here is a lin that shows how to create a table.

www.java2s/Code/CSharp/Database-ADO/UseExecuteNonQuerytorunDDLstatementscreatetable.htm

在数据库中创建表之后.

Once the table is created in the database.

您可以使用数据集的writeschema方法来编写模式.

you can use the writeschema method of the dataset to write the schema.

ADO.NET数据集提供了将其内容写为XML或直接通过它的WriteXml或WriteXmlSchema方法作为Schema.使用FileStream,您可以 将输出捕获到平面文件.最近,我不得不执行此操作来创建与Infragistics Ultrawingrid控件一起使用的数据源架构.

The ADO.NET DataSet provides the ability to write its contents out as XML or as a Schema directly through it's WriteXml or WriteXmlSchema methods. Using a FileStream, you can capture the output to a flat file. I recently had to do this to create a datasource schema for use with a Infragistics ultrawingrid control.

这是显示如何编写模式的链接.

here is link that shows how to write the schema.

samgaut.blogspot/2008/01/use-dataset-writeschema-method.html

该方法也可用于数据表.

The method is also availabe for datatable.

更多推荐

在创建SQL模式时需要帮助

本文发布于:2023-10-26 23:05:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531608.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时需   模式   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!