Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / February 2007

Tip: Looking for answers? Try searching our database.

DataSet/XmlSchema/DataGrid Framework 1.1 - 2.0 Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Madreza - 26 Feb 2007 15:25 GMT
Hi,

I have a problem with reading an XmlSchema with Frameowk 2.0 and an
own DataType. I found no example
(searching two days).

What I do is:

DataSet dataSet = new DataSet();
dataSet.ReadXml("{path}/MySchemaAndData.xml");

dataView = dataSet.Tables[0];
dataGridView.DataSource = dataView;

Easy with Framework 1.1 (VisualStudio 2003). Everything is working
fine. Now with rameowrk 2.0 I get one
error after another, maybe someone can help me solve the problem,
knows a link or what ever. I'm really
despairing.

If need, i can write more information, what i tried unsuccesfully for
the last 20h.

The Schema looks like following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Data version="V1.0.0.0">
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="daten"
xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   <xs:element name="data" msdata:IsDataSet="true" msdata:Locale="de-
DE">
     <xs:complexType>
       <xs:choice maxOccurs="unbounded">
         <xs:element name="aTableName" msdata:Expression="Column">
           <xs:complexType>
             <xs:attribute name="Column" type="xs:string"
type="xs:string" msdata:DataType="MyNamespace.MyClass, MyAssemlyName,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>/>
           </xs:complexType>
         </xs:element>
       </xs:choice>
     </xs:complexType>
   </xs:element>
 </xs:schema>
 <aTableName Column="1"/>
</Data>
John Saunders - 26 Feb 2007 17:40 GMT
> Hi,
>
> I have a problem with reading an XmlSchema with Frameowk 2.0 and an
> own DataType. I found no example
> (searching two days).
...
> The Schema looks like following:
>
[quoted text clipped - 19 lines]
>  <aTableName Column="1"/>
> </Data>

As a first guess, I'd suggest you extract that schema from the data.
Secondly, your data does not match your schema. "Data" is not the same as
"data".

John
Martin Madreza - 27 Feb 2007 09:21 GMT
hi,

yes sorry, i copied the schema from the original and modified a litte
(from german tio english)...

i extract the dqata from the data set with a testproject, the result
is, that

'msdata:DataType="MyNamespace.MyClass, MyAssemlyName'

becomes an element. it's not possible to set them (in the dataset) to
an attribute. the element is under a xs:sequence, and the structur
changes...

so far it works. but i cant set the value from the schema. in the
example below column value 1 is never set. in 1.1 everything works,
now i found nothing about what changed in 2.0 and what i have to
change to make it work. does any example exist with DataType =
OwnDataType?

hope you can help me to come forward... and sorry for the bad example.
if something ambiguous, please tell and i try to specify it

here is the example

<?xml version="1.0" standalone="yes"?>
<data>
 <xs:schema id="data" xmlns="" xmlns:xs="http://www.w3.org/2001/
XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   <xs:element name="data" msdata:IsDataSet="true" msdata:Locale="de-
DE">
     <xs:complexType>
       <xs:choice minOccurs="0" maxOccurs="unbounded">
         <xs:element name="aTableName">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="Column" type="xs:string"
msdata:DataType="MyNamespace.MyClass, MyAssemlyName, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null"/>/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>
       </xs:choice>
     </xs:complexType>
   </xs:element>
 </xs:schema>
 <aTableName>
   <Column>1</Column>
 </aTableName>
</data>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.