LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel rejects XSD from Visual Studio DataSet Designer.

Visual Studio 2008 SP1, .NET 3.5 SP1, Excel 2003 & Excel 2007

In Visual Studio within a C# project add a DataSet to the project. Within
the Toolbox there is only one possible choice if you are not using a database
- the DataTable, select this and add a column to the empty table.

Excel can read the XSD (and data) but it can not export data entered on the
spread sheet to an XML file, the map is not exportable because "a mapped
element's relationship with other elements cannot be preserved".

Here is the generated XSD:

<?xml version="1.0" encoding="utf-8"?
<xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd"
xmlns:mstns="http://tempuri.org/DataSet1.xsd"
xmlns="http://tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
attributeFormDefault="qualified" elementFormDefault="qualified"
<xs:annotation
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass,
Class, Public" SchemaSerializationMode="IncludeSchema"
xmlns="urn:schemas-microsoft-com:xml-msdatasource"
<Connections /
<Tables /
<Sources /
</DataSource
</xs:appinfo
</xs:annotation
<xs:element name="DataSet1" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DataSet1"
msprop:Generator_UserDSName="DataSet1"
msprop:EnableTableAdapterManager="true"
<xs:complexType
<xs:choice minOccurs="0" maxOccurs="unbounded"
<xs:element name="DataTable1"
msprop:Generator_UserTableName="DataTable1"
msprop:Generator_RowDeletedName="DataTable1RowDele ted"
msprop:Generator_TableClassName="DataTable1DataTab le"
msprop:Generator_RowChangedName="DataTable1RowChan ged"
msprop:Generator_RowClassName="DataTable1Row"
msprop:Generator_RowChangingName="DataTable1RowCha nging"
msprop:Generator_RowEvArgName="DataTable1RowChange Event"
msprop:Generator_RowEvHandlerName="DataTable1RowCh angeEventHandler"
msprop:Generator_TablePropName="DataTable1"
msprop:Generator_TableVarName="tableDataTable1"
msprop:Generator_RowDeletingName="DataTable1RowDel eting"
<xs:complexType
<xs:sequence
<xs:element name="DataColumn1"
msprop:Generator_UserColumnName="DataColumn1"
msprop:Generator_ColumnPropNameInRow="DataColumn1"
msprop:Generator_ColumnVarNameInTable="columnDataC olumn1"
msprop:Generator_ColumnPropNameInTable="DataColumn 1Column" type="xs:string"
minOccurs="0" /
</xs:sequence
</xs:complexType
</xs:element
</xs:choice
</xs:complexType
</xs:element
</xs:schema

If you modify it to be:

<?xml version="1.0" encoding="utf-8"?
<xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd"
xmlns:mstns="http://tempuri.org/DataSet1.xsd"
xmlns="http://tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
attributeFormDefault="qualified" elementFormDefault="qualified"
<xs:annotation
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter"
GeneratorFunctionsComponentClassName="QueriesTable Adapter"
Modifier="AutoLayout, AnsiClass, Class, Public"
SchemaSerializationMode="IncludeSchema"
UserFunctionsComponentName="QueriesTableAdapter"
xmlns="urn:schemas-microsoft-com:xml-msdatasource"
<Connections /
<Tables /
<Sources /
</DataSource
</xs:appinfo
</xs:annotation
<xs:element name="dataroot"
<xs:complexType
<xs:sequence
<xs:element ref="DataSet1" minOccurs="0" maxOccurs="unbounded" /
</xs:sequence
<xs:attribute name="generated" type="xs:dateTime" /
</xs:complexType
</xs:element
<xs:element name="DataSet1" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DataSet1"
msprop:Generator_UserDSName="DataSet1"
msprop:EnableTableAdapterManager="true"
<!--
<xs:complexType
<xs:choice minOccurs="0" maxOccurs="unbounded"
<xs:element name="DataTable1"
msprop:Generator_UserTableName="DataTable1"
msprop:Generator_RowDeletedName="DataTable1RowDele ted"
msprop:Generator_TableClassName="DataTable1DataTab le"
msprop:Generator_RowChangedName="DataTable1RowChan ged"
msprop:Generator_RowClassName="DataTable1Row"
msprop:Generator_RowChangingName="DataTable1RowCha nging"
msprop:Generator_RowEvArgName="DataTable1RowChange Event"
msprop:Generator_RowEvHandlerName="DataTable1RowCh angeEventHandler"
msprop:Generator_TablePropName="DataTable1"
msprop:Generator_TableVarName="tableDataTable1"
msprop:Generator_RowDeletingName="DataTable1RowDel eting"
--
<xs:complexType
<xs:sequence
<xs:element name="DataColumn1"
msprop:Generator_UserColumnName="DataColumn1"
msprop:Generator_ColumnPropNameInRow="DataColumn1"
msprop:Generator_ColumnVarNameInTable="columnDataC olumn1"
msprop:Generator_ColumnPropNameInTable="DataColumn 1Column" type="xs:string"
minOccurs="0" /
</xs:sequence
</xs:complexType
<!--
</xs:element
</xs:choice
</xs:complexType
--
</xs:element
</xs:schema

The DataSet is now exportable, but the strongly typed class generated by the
designer no longer matches the XSD and so will not work.

How do you generate an XSD using the Visual Studio DataSet designer that is
usable by Excel?

I originaly posted this in:

MSDN Forums » Data Platform Development » XML and the .NET Framework but
have not had a reply.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel rejects XSD from Visual Studio DataSet Designer rico Excel Discussion (Misc queries) 0 September 16th 08 09:35 PM
C# Visual Studio connect Excel to AS/400 [email protected] Excel Programming 1 September 20th 06 03:40 AM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
excel object in visual studio Easwaran Excel Programming 4 September 9th 05 01:13 PM
Visual Studio .Net C# and Excel Adam Excel Programming 2 March 24th 05 03:33 PM


All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"