473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VB 2002 Freaking Out with Datasets!

Hi!

I am frustrated! I spent a lot of time designing a custom dataset schema
(XSD file) using the Dataset designer. In my main form I had created an
instance of a typed dataset using that schema, and all was going well for
days. Now, tonight, I suddenly opened up the solution and 1) the dataset is
gone from the main form, and 2) I can't re-instantiate it. When I drag a new
dataset onto the control surface, my XSD file is no longer listed... I just
see (no datasets in project).

I've tried copying the contents of that file into a new dataset, with no
luck. Why would VB suddenly go berserk on me like this? And how can I
comvince it that, yes, there IS a dataset schema all ready to use?

---P

Apr 13 '07 #1
4 2270
"Peter" <st*****@hotmail.comwrote in message
news:Ao*******************@newsread1.news.pas.eart hlink.net...
Hi!

I am frustrated! I spent a lot of time designing a custom dataset schema
(XSD file) using the Dataset designer. In my main form I had created an
instance of a typed dataset using that schema, and all was going well for
days. Now, tonight, I suddenly opened up the solution and 1) the dataset
is gone from the main form, and 2) I can't re-instantiate it. When I drag
a new dataset onto the control surface, my XSD file is no longer listed...
I just see (no datasets in project).

I've tried copying the contents of that file into a new dataset, with no
luck. Why would VB suddenly go berserk on me like this? And how can I
comvince it that, yes, there IS a dataset schema all ready to use?
Update on the problem: there is something wrong with the XSD file preventing
it from being turned into a dataset. It's giving me the error:

Invalid XPath selection inside field node. Cannot find: ID.

Is there any way to tell what line this is happening at? I am not very good
at reading these files (and I can't figure out why there is suddenly an
error... .NET generated this for me!). Most of this file (including the
table relations) worked not 24 hours ago.

In case it would help if I posted the entire XSD file, here it is:

***
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Papers" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Papers" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Paper" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1"
msdata:AutoIncrement="true" msdata:AutoIncrementSeed="0"
msdata:AutoIncrementStep="1" maxOccurs="1" />
<xs:element name="Size" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Weight" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Brand" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="PagesPerSet" type="xs:int" minOccurs="1"
maxOccurs="1" />
<xs:element name="Type" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Color" type="xs:int" minOccurs="1"
maxOccurs="unbounded" default="0" />
<xs:element name="Finish" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="WholesalePrice" type="xs:double" minOccurs="1"
maxOccurs="1" default="0" />
<xs:element name="IsFree" type="xs:boolean" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Size">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" maxOccurs="1" minOccurs="1"
msdata:AutoIncrement="true" msdata:AutoIncrementSeed="0"
msdata:AutoIncrementStep="1" />
<xs:element name="XInches" type="xs:double" maxOccurs="1"
minOccurs="1" />
<xs:element name="YInches" type="xs:double" minOccurs="1"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Color">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" maxOccurs="1" minOccurs="1"
msdata:AutoIncrementSeed="0" msdata:AutoIncrementStep="1"
msdata:AutoIncrement="true" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Hex" type="xColor" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Weight">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1"
msdata:AutoIncrementSeed="0" msdata:AutoIncrementStep="1"
msdata:AutoIncrement="true" />
<xs:element name="Pounds" type="xs:int" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Brand">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Type">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Finish">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="PaperKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Paper" />
<xs:field xpath="ID" />
</xs:key>
<xs:key name="SizeKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Size" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="PaperSize" refer="SizeKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Size" />
</xs:keyref>
<xs:key name="ColorKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Color" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="PaperColor" refer="ColorKey"
msdata:AcceptRejectRule="Cascade" msdata:UpdateRule="Cascade"
msdata:DeleteRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Color" />
</xs:keyref>
<xs:key name="WeightKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Weight" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="WeightPaper" refer="WeightKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Weight" />
</xs:keyref>
<xs:key name="BrandKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Brand" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="BrandPaper" refer="BrandKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Brand" />
</xs:keyref>
<xs:key name="TypeKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Type" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="TypePaper" refer="TypeKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Type" />
</xs:keyref>
<xs:key name="FinishKey" msdata:PrimaryKey="true">
<xs:selector xpath=".//Finish" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="FinishPaper" refer="FinishKey"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Finish" />
</xs:keyref>
</xs:element>
<xs:simpleType name="xColor">
<xs:restriction base="xs:string">
<xs:length value="6" />
<xs:pattern value="[0-9A-F]{6}" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

Apr 13 '07 #2
Update on the problem: there is something wrong with the XSD file
preventing it from being turned into a dataset. It's giving me the error:

Invalid XPath selection inside field node. Cannot find: ID.

Is there any way to tell what line this is happening at? I am not very
good at reading these files (and I can't figure out why there is suddenly
an error... .NET generated this for me!). Most of this file (including the
table relations) worked not 24 hours ago.
I have nailed down the cause of the problem. I made the seemingly small
change of switching the maxOccurs of the Color element of table Paper to
unbounded (the previous value was 1). For some reason, that caused the
dataset parser to change that table element into a table of its own,
creating a conflict between itself and the other, separate table which I
manually created, also named Color.

Apr 13 '07 #3
Peter,

Mostly this kind of errors comes because that you have used the class name
again in your code.

Can you have a look for that.

Or deleteted it and added it again.

Cor

"Peter" <st*****@hotmail.comschreef in bericht
news:Ao*******************@newsread1.news.pas.eart hlink.net...
Hi!

I am frustrated! I spent a lot of time designing a custom dataset schema
(XSD file) using the Dataset designer. In my main form I had created an
instance of a typed dataset using that schema, and all was going well for
days. Now, tonight, I suddenly opened up the solution and 1) the dataset
is gone from the main form, and 2) I can't re-instantiate it. When I drag
a new dataset onto the control surface, my XSD file is no longer listed...
I just see (no datasets in project).

I've tried copying the contents of that file into a new dataset, with no
luck. Why would VB suddenly go berserk on me like this? And how can I
comvince it that, yes, there IS a dataset schema all ready to use?

---P

Apr 13 '07 #4
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Peter,

Mostly this kind of errors comes because that you have used the class name
again in your code.

Can you have a look for that.

Or deleteted it and added it again.
I did find the problem... I was trying to use foreign keys to define a
many-to-many relationship. I now know I can't do that. I don't know what I
can do instead, but I will probably learn that tomorrey.

Apr 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brian Kiser | last post by:
What is Microsoft's stance on developing business objects vs datasets when creating n-tier apps. Is anyone doing business objects? It appears that most articles from MS recommend passing...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
6
by: NickName | last post by:
I'm dealing with a database with tables that have freaking columns. Partial DDL: Create table ( varchar(10)) -- yeah, this column contains string value Now, I'd like to rename all these...
3
by: Mike | last post by:
Hi! I also asked this question in C# group with no results: I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd...
0
by: Bj?rn Mor?n | last post by:
I am consuming a web service that returns arrays of classes which can contain other classes (a hierarchy of data). Is there a simple way to move the data into a typed DataSet without writing too...
4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
2
by: Dan Cooper | last post by:
I've got two datasets, each containing a single data table. dstDataSetA.Tables("TableA") dstDataSetB.Tables("TableB") I want to merge them together and delete any non-matching rows. ...
0
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
9
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.