Advertisement

08.22.2008 at 08:07AM PDT, ID: 23670465
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Write XML Schema using recordset.

Asked by arunkumarmanas in .NET, Microsoft Visual Basic.Net

Tags: ,

I have a simple vb.net program that creates an xmlschema using the dataset method Writexmlschema (see #1). It creates a file (see #2), but I would like a file that looks like #3
#3 is DIFFERENT from #2 is that
    #2 is "xml-msdata" where as #3 is  "mapping-schema"
    #2 does not have "relation" attribute but #3 has
 Why is my code producing this when others
produce #3?
====================
#1 - My Code
====================
Dim ds As New DataSet()


Dim cn As New SqlClient.SqlConnection("user id=sa;password=;initial
catalog=criminals;data source=(local);Connect Timeout=30;pooling=true")
cn.Open()

Dim cmd As New SqlClient.SqlCommand("SELECT * from serialkillers ", cn)
Dim da As New Data.SqlClient.SqlDataAdapter(cmd)

da.Fill(ds)

ds.Tables(0).TableName = "serialkillers"

Dim schemaFileName = "c:\XmlSchemaFile.xsd"
Dim xmlFileName = "c:\XmlDataFile.xml"
ds.WriteXml(xmlFileName)
ds.WriteXmlSchema(schemaFileName)

====================
#2 - My Output Schema - Why no 'XSD:'??
====================

<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true";>
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Pivot">
<xs:complexType>
<xs:sequence>
<xs:element name="Piv_Identity" type="xs:int" minOccurs="0" />
<xs:element name="Year" type="xs:short" minOccurs="0" />
<xs:element name="Quarter" type="xs:unsignedByte"
minOccurs="0" />
<xs:element name="Amount" type="xs:decimal" minOccurs="0" />
<xs:element name="Hrs" type="xs:int" minOccurs="0" />
<xs:element name="Hrs_F" type="xs:double" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

====================
#3 - Other people's schemas
====================

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:codegen="urn:schemas-microsoft-com:xml-msprop">
<xsd:element name="TestTableNew" sql:relation="TestTableNew" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="A" type="xsd:string" />
<xsd:element name="B" type="xsd:integer" />
<xsd:element name="C" type="xsd:integer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Start Free Trial
[+][-]08.27.2008 at 01:24PM PDT, ID: 22328834

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Microsoft Visual Basic.Net
Tags: Microsoft, Visual Studio 2005, SQL Server 2000
Sign Up Now!
Solution Provided By: armoghan
Participating Experts: 1
Solution Grade: B
 
 
[+][-]08.28.2008 at 02:58AM PDT, ID: 22333115

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 03:12AM PDT, ID: 22333184

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 03:29AM PDT, ID: 22333258

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628