XML DataSet schema

J

jez

Dear All,

I'm trying to create a .xsd schema for my CF application. All I'd like to do
is create two tables in the schema. The xml schema would then be loaded up
into a DataSet to create those two tables. I tried adding a new item in my
project but when I click open (after writing "schema.xsd" and selecting xml
file) I get the following error : " The XML designer encountered the
following error while reading this file : The root element is missing.
Please return to source view and correct these errors". I don't quite
understand that error, could anyone help me please?

Once the schema is created and I read the schema into a dataset, the two
tables will be automatically created - is that correct ?

Thanks a lot ,

jez
 
I

Ilya Tumanov [MS]

Jez,

I'm not exactly sure how you adding XSD schema to a CF application.
Typed DataSet's are not supported by CF designers, so there's no XML schema
item in CF designer.
I suppose, you can add XSD file created outside CF project, however it
might be impossible to use designer on it.
If you can do it, the message you're getting means file is in bad format,
probably empty. Make sure you can open it in IE.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
J

jez

Ilya,

I know typed datasets are not supported by the CF. I did somehow manage to
create a xsd file at the end. What I do now is read the xml schema each time
I start my app. Even though I added a primary key to the xsd schema (I can
see the little key next to the element) it still seems as if it's not
recorded as a primary key. I gathered that when trying to use the .Find()
method that looks for a PK in a DataTable - I get an exception. It is not as
such a problem as I just used the .Select() method instead but I'd be
interested to know if you have any idea what could be wrong.

All the best,
jez

"Ilya Tumanov [MS]" said:
Jez,

I'm not exactly sure how you adding XSD schema to a CF application.
Typed DataSet's are not supported by CF designers, so there's no XML schema
item in CF designer.
I suppose, you can add XSD file created outside CF project, however it
might be impossible to use designer on it.
If you can do it, the message you're getting means file is in bad format,
probably empty. Make sure you can open it in IE.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML DataSet schema
Date: Mon, 5 Jan 2004 13:16:28 +0100
Organization: Wanadoo Belgium
Lines: 19
Message-ID: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1073305001 1387140 213.177.151.7 (5 Jan 2004 12:16:41 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 5 Jan 2004 12:16:41 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:42145
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Dear All,

I'm trying to create a .xsd schema for my CF application. All I'd like
to
do
is create two tables in the schema. The xml schema would then be loaded up
into a DataSet to create those two tables. I tried adding a new item in my
project but when I click open (after writing "schema.xsd" and selecting xml
file) I get the following error : " The XML designer encountered the
following error while reading this file : The root element is missing.
Please return to source view and correct these errors". I don't quite
understand that error, could anyone help me please?

Once the schema is created and I read the schema into a dataset, the two
tables will be automatically created - is that correct ?

Thanks a lot ,

jez
 
I

Ilya Tumanov [MS]

Jez,

Make sure you schema is indeed correct. Try this schema on a desktop
application and see if it works the same way as on CF.
Also, is this schema changing all the time? If not, just create tables and
relations programmatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Tue, 20 Jan 2004 09:08:18 +0100
Organization: Wanadoo Belgium
Lines: 92
Message-ID: <[email protected]>
References: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074586115 1365218 213.177.151.7 (20 Jan 2004 08:08:35 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 20 Jan 2004 08:08:35 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.n
et!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai
l
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43467
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya,

I know typed datasets are not supported by the CF. I did somehow manage to
create a xsd file at the end. What I do now is read the xml schema each time
I start my app. Even though I added a primary key to the xsd schema (I can
see the little key next to the element) it still seems as if it's not
recorded as a primary key. I gathered that when trying to use the .Find()
method that looks for a PK in a DataTable - I get an exception. It is not as
such a problem as I just used the .Select() method instead but I'd be
interested to know if you have any idea what could be wrong.

All the best,
jez

"Ilya Tumanov [MS]" said:
Jez,

I'm not exactly sure how you adding XSD schema to a CF application.
Typed DataSet's are not supported by CF designers, so there's no XML schema
item in CF designer.
I suppose, you can add XSD file created outside CF project, however it
might be impossible to use designer on it.
If you can do it, the message you're getting means file is in bad format,
probably empty. Make sure you can open it in IE.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML DataSet schema
Date: Mon, 5 Jan 2004 13:16:28 +0100
Organization: Wanadoo Belgium
Lines: 19
Message-ID: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1073305001 1387140 213.177.151.7 (5
Jan
2004 12:16:41 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 5 Jan 2004 12:16:41 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
loaded
in
my selecting
xml
 
J

jez

I used to have the relations and tables defined programatically but then I
thought I'd try out the xsd schemas (looks nicer and easier to change).
Basically the main problem I had with programmatic relaions was the multiple
primary keys - couldn't figure out how to have them. So this is where I
decided to jump to xsd schemas which are nice and neat but don't seem to be
extremely effective:p

"Ilya Tumanov [MS]" said:
Jez,

Make sure you schema is indeed correct. Try this schema on a desktop
application and see if it works the same way as on CF.
Also, is this schema changing all the time? If not, just create tables and
relations programmatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Tue, 20 Jan 2004 09:08:18 +0100
Organization: Wanadoo Belgium
Lines: 92
Message-ID: <[email protected]>
References: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074586115 1365218 213.177.151.7 (20
Jan
2004 08:08:35 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 20 Jan 2004 08:08:35 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai
l
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43467
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Ilya,

I know typed datasets are not supported by the CF. I did somehow manage to
create a xsd file at the end. What I do now is read the xml schema each time
I start my app. Even though I added a primary key to the xsd schema (I can
see the little key next to the element) it still seems as if it's not
recorded as a primary key. I gathered that when trying to use the ..Find()
method that looks for a PK in a DataTable - I get an exception. It is
not
as
such a problem as I just used the .Select() method instead but I'd be
interested to know if you have any idea what could be wrong.

All the best,
jez

"Ilya Tumanov [MS]" said:
Jez,

I'm not exactly sure how you adding XSD schema to a CF application.
Typed DataSet's are not supported by CF designers, so there's no XML schema
item in CF designer.
I suppose, you can add XSD file created outside CF project, however it
might be impossible to use designer on it.
If you can do it, the message you're getting means file is in bad format,
probably empty. Make sure you can open it in IE.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: XML DataSet schema
Date: Mon, 5 Jan 2004 13:16:28 +0100
Organization: Wanadoo Belgium
Lines: 19
Message-ID: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1073305001 1387140 213.177.151.7 (5 Jan
2004 12:16:41 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 5 Jan 2004 12:16:41 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
like
to loaded in
 
I

Ilya Tumanov [MS]

By multiple primary keys, do you mean primary keys in several tables or
primary key, constructed out of several columns?
Actually, you can use DataTable.PrimaryKey property to do both.
It accepts an array of DataColumn so you can construct a complex primary
key.

However, I would advise against using several columns as a primary key.
It's a bad practice from both database design and performance point of view.
Consider adding surrogate primary key column.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Wed, 21 Jan 2004 08:50:41 +0100
Organization: Wanadoo Belgium
Lines: 175
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074671460 1161516 213.177.151.7 (21 Jan 2004 07:51:00 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Wed, 21 Jan 2004 07:51:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!news.tele.dk!news.tele.
dk!small.news.tele.dk!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ne
ws.be.wanadoo.com!news.wanadoo.be!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43592
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I used to have the relations and tables defined programatically but then I
thought I'd try out the xsd schemas (looks nicer and easier to change).
Basically the main problem I had with programmatic relaions was the multiple
primary keys - couldn't figure out how to have them. So this is where I
decided to jump to xsd schemas which are nice and neat but don't seem to be
extremely effective:p

"Ilya Tumanov [MS]" said:
Jez,

Make sure you schema is indeed correct. Try this schema on a desktop
application and see if it works the same way as on CF.
Also, is this schema changing all the time? If not, just create tables and
relations programmatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Tue, 20 Jan 2004 09:08:18 +0100
Organization: Wanadoo Belgium
Lines: 92
Message-ID: <[email protected]>
References: <[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074586115 1365218 213.177.151.7 (20
Jan
2004 08:08:35 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 20 Jan 2004 08:08:35 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai manage
to each
time not (5
Jan
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
item
in the
two
 
J

jez

Basically I wanted to add two (or three) primary keys in a single table. The
main reason for that is that it _should_ be faster to find DataRows using PK
as search keys. In the meantime I just managed to do it without the PK's, I
do the basic select operation. I'm just wondering whether there are any
performance implications when using the Select method instead of the Find
method.

"Ilya Tumanov [MS]" said:
By multiple primary keys, do you mean primary keys in several tables or
primary key, constructed out of several columns?
Actually, you can use DataTable.PrimaryKey property to do both.
It accepts an array of DataColumn so you can construct a complex primary
key.

However, I would advise against using several columns as a primary key.
It's a bad practice from both database design and performance point of view.
Consider adding surrogate primary key column.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Wed, 21 Jan 2004 08:50:41 +0100
Organization: Wanadoo Belgium
Lines: 175
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074671460 1161516 213.177.151.7 (21
Jan
2004 07:51:00 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Wed, 21 Jan 2004 07:51:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ne
ws.be.wanadoo.com!news.wanadoo.be!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43592
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I used to have the relations and tables defined programatically but then I
thought I'd try out the xsd schemas (looks nicer and easier to change).
Basically the main problem I had with programmatic relaions was the multiple
primary keys - couldn't figure out how to have them. So this is where I
decided to jump to xsd schemas which are nice and neat but don't seem to be
extremely effective:p

"Ilya Tumanov [MS]" said:
Jez,

Make sure you schema is indeed correct. Try this schema on a desktop
application and see if it works the same way as on CF.
Also, is this schema changing all the time? If not, just create tables and
relations programmatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Tue, 20 Jan 2004 09:08:18 +0100
Organization: Wanadoo Belgium
Lines: 92
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074586115 1365218 213.177.151.7
(20
Jan
2004 08:08:35 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Tue, 20 Jan 2004 08:08:35 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai
manage (I
can is
not
however
213.177.151.7
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
 
I

Ilya Tumanov [MS]

Jez,

You can not have several primary keys; it's pretty much like having two
left hands. :)
Please take a look here:
http://searchdatabase.techtarget.com/sDefinition/0,,sid13_gci902812,00.html

I think you're talking about indexes, not primary keys.
You sure can have several indexes to improve searching performance.
In ADO.Net index is out of your control and might be created for you as you
perform searching.

As to performance of Find vs. Select, I would say Select will be slower as
you need to parse expression.
However, search itself might be exactly the same. The best way to go is to
try it on...

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Thu, 22 Jan 2004 15:13:15 +0100
Organization: Wanadoo Belgium
Lines: 277
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074780814 1205098 213.177.151.7 (22 Jan 2004 14:13:34 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Thu, 22 Jan 2004 14:13:34 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!irazu.
switch.ch!switch.ch!ecngs!feeder.ecngs.de!feed1.news.be.easynet.net!news.be.
wanadoo.com!news.wanadoo.be!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43734
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Basically I wanted to add two (or three) primary keys in a single table. The
main reason for that is that it _should_ be faster to find DataRows using PK
as search keys. In the meantime I just managed to do it without the PK's, I
do the basic select operation. I'm just wondering whether there are any
performance implications when using the Select method instead of the Find
method.

"Ilya Tumanov [MS]" said:
By multiple primary keys, do you mean primary keys in several tables or
primary key, constructed out of several columns?
Actually, you can use DataTable.PrimaryKey property to do both.
It accepts an array of DataColumn so you can construct a complex primary
key.

However, I would advise against using several columns as a primary key.
It's a bad practice from both database design and performance point of view.
Consider adding surrogate primary key column.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Wed, 21 Jan 2004 08:50:41 +0100
Organization: Wanadoo Belgium
Lines: 175
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074671460 1161516 213.177.151.7 (21
Jan
2004 07:51:00 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Wed, 21 Jan 2004 07:51:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ne then
I to
be tables
and
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai schema
(I however 213.177.151.7
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
new
item encountered
the dataset,
the
 
J

jez

lol!

it seems like I've got two left hands when it comes to programming in the
CF:p
Well okay then.. assuming I'd be using an index, would there be any useful
search method in the CF that I could use to improve the performance?
- we're talking here about a customers table with an avg of 50 customers and
a products table with an average of 4 products per customer (so about
200-250 products in the products table).. any chances that an index or
anything else would improve the perf. ?



"Ilya Tumanov [MS]" said:
Jez,

You can not have several primary keys; it's pretty much like having two
left hands. :)
Please take a look here:
http://searchdatabase.techtarget.com/sDefinition/0,,sid13_gci902812,00.html

I think you're talking about indexes, not primary keys.
You sure can have several indexes to improve searching performance.
In ADO.Net index is out of your control and might be created for you as you
perform searching.

As to performance of Find vs. Select, I would say Select will be slower as
you need to parse expression.
However, search itself might be exactly the same. The best way to go is to
try it on...

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Thu, 22 Jan 2004 15:13:15 +0100
Organization: Wanadoo Belgium
Lines: 277
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074780814 1205098 213.177.151.7 (22
Jan
2004 14:13:34 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Thu, 22 Jan 2004 14:13:34 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08..phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!irazu.switch.ch!switch.ch!ecngs!feeder.ecngs.de!feed1.news.be.easynet.net!news.be.
wanadoo.com!news.wanadoo.be!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.compactframework:43734
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Basically I wanted to add two (or three) primary keys in a single table. The
main reason for that is that it _should_ be faster to find DataRows
using
PK
as search keys. In the meantime I just managed to do it without the
PK's,
I
do the basic select operation. I'm just wondering whether there are any
performance implications when using the Select method instead of the Find
method.

"Ilya Tumanov [MS]" said:
By multiple primary keys, do you mean primary keys in several tables or
primary key, constructed out of several columns?
Actually, you can use DataTable.PrimaryKey property to do both.
It accepts an array of DataColumn so you can construct a complex primary
key.

However, I would advise against using several columns as a primary key.
It's a bad practice from both database design and performance point of view.
Consider adding surrogate primary key column.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "jez" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: Re: XML DataSet schema
Date: Wed, 21 Jan 2004 08:50:41 +0100
Organization: Wanadoo Belgium
Lines: 175
Message-ID: <[email protected]>
References: <[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
NNTP-Posting-Host: adsl-151-7.wanadoo.be
X-Trace: sinclair.be.wanadoo.com 1074671460 1161516 213.177.151.7
(21
Jan
2004 07:51:00 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Wed, 21 Jan 2004 07:51:00 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!npeer.de.kpn-eurorings.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ne
where
seem
to 213.177.151.7
(20
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-mai
schema it's
not It
is I'd
be no
XML confers
no
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!130.5910.21.MISMATCH!irazu.switch.ch!switch.ch!solnet.ch!solnet.ch!newsfeed.tiscali.ch!feed1.news.be.easynet.net!news.be.wanadoo.com!news.wanadoo.be!not-for-
then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top