Dataset Properties Descrepencies From Table Design

  • Thread starter Thread starter Bob Day
  • Start date Start date
B

Bob Day

VS 2003 VB net sql msde...

I used Server Explorer, Design Table, to define two tables primary keys
identically (i.e. autoincrement, same seed & increment, both clustered,
etc.)

In Component designer, I create a DataAdapter for each table above and then
generate the dataset adding the tables above to the dataset. However, when
I look at dataset properties (right click on DataSet), one of the two
primary keys is how I defined it in Design Table above, but the other one is
not.

This problem exists with many other tables, and I can see no pattern or
reason.

Is Dataset Properties reporting the wrong information? What is the problem
here? I would think this info would be pulled directly from the Design
Table information.

Please advise

Bob Day
 
Hi Bob,

It seems that you lost the primary key definition in the original dataset
when generating dataset from a DataAdapter.

Please try to check it you have set the primary key in the database table.
Because if you didn't set the primary key in database, when generating
DataSet with a DataAdapter, VS .net will ask you if you want to modify the
original dataset. If you choose yes, it will replace the old dataset schema
with the table in MSDE. Since no primary key is set in it, the new
generated dataset doesn't have a primary key, either.

Does this answer your question? If anything is unclear, please feel free to
reply to the post.

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

--------------------
| From: "Bob Day" <[email protected]>
| Subject: Dataset Properties Descrepencies From Table Design
| Date: Thu, 9 Oct 2003 21:37:45 -0500
| Lines: 25
| 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
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: dhcp065-029-072-239.indy.rr.com 65.29.72.239
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63339
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| VS 2003 VB net sql msde...
|
| I used Server Explorer, Design Table, to define two tables primary keys
| identically (i.e. autoincrement, same seed & increment, both clustered,
| etc.)
|
| In Component designer, I create a DataAdapter for each table above and
then
| generate the dataset adding the tables above to the dataset. However,
when
| I look at dataset properties (right click on DataSet), one of the two
| primary keys is how I defined it in Design Table above, but the other one
is
| not.
|
| This problem exists with many other tables, and I can see no pattern or
| reason.
|
| Is Dataset Properties reporting the wrong information? What is the
problem
| here? I would think this info would be pulled directly from the Design
| Table information.
|
| Please advise
|
| Bob Day
|
|
|
|
 
No, here is the reason:
If a DataAdapter in the Component Designer has 1 table used for the select
statement, then the Key symbol will show up for the primary key under
DataSet properties. If there are 2 or more tables used for the select
statement in the DataAdapter, then the key symbol won't show up under
DataSet properties. Not sure exactly why, but it doesn't seem to affect
anything.

Thanks
bob
 
Hi Bob,

I followed your steps and reproduced the problem. I found that if there are
2 or more tables joined in the SELECT command, you have to select both
primary keys of the two table. If not, a message box, which says "The
wizard cannot automatically create queries for updating the database
because your query does not include some primary key columns. Do you wish
to add primary key columns to your query?", will be show to ask you whether
to select them. If you choose no, and generate the dataset, the primary key
information in the dataset will be lost. Please try to select both primary
keys of the 2 table to see if it works.

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

--------------------
| From: "Bob Day" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Dataset Properties Descrepencies From Table Design
| Date: Thu, 16 Oct 2003 13:21:38 -0500
| Lines: 86
| 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
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: dhcp065-029-072-019.indy.rr.com 65.29.72.19
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63791
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| No, here is the reason:
| If a DataAdapter in the Component Designer has 1 table used for the select
| statement, then the Key symbol will show up for the primary key under
| DataSet properties. If there are 2 or more tables used for the select
| statement in the DataAdapter, then the key symbol won't show up under
| DataSet properties. Not sure exactly why, but it doesn't seem to affect
| anything.
|
| Thanks
| bob
|
| | > Hi Bob,
| >
| > It seems that you lost the primary key definition in the original
dataset
| > when generating dataset from a DataAdapter.
| >
| > Please try to check it you have set the primary key in the database
table.
| > Because if you didn't set the primary key in database, when generating
| > DataSet with a DataAdapter, VS .net will ask you if you want to modify
the
| > original dataset. If you choose yes, it will replace the old dataset
| schema
| > with the table in MSDE. Since no primary key is set in it, the new
| > generated dataset doesn't have a primary key, either.
| >
| > Does this answer your question? If anything is unclear, please feel free
| to
| > reply to the post.
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "Bob Day" <[email protected]>
| > | Subject: Dataset Properties Descrepencies From Table Design
| > | Date: Thu, 9 Oct 2003 21:37:45 -0500
| > | Lines: 25
| > | 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
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: dhcp065-029-072-239.indy.rr.com 65.29.72.239
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63339
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | VS 2003 VB net sql msde...
| > |
| > | I used Server Explorer, Design Table, to define two tables primary
keys
| > | identically (i.e. autoincrement, same seed & increment, both
clustered,
| > | etc.)
| > |
| > | In Component designer, I create a DataAdapter for each table above and
| > then
| > | generate the dataset adding the tables above to the dataset. However,
| > when
| > | I look at dataset properties (right click on DataSet), one of the two
| > | primary keys is how I defined it in Design Table above, but the other
| one
| > is
| > | not.
| > |
| > | This problem exists with many other tables, and I can see no pattern
or
| > | reason.
| > |
| > | Is Dataset Properties reporting the wrong information? What is the
| > problem
| > | here? I would think this info would be pulled directly from the
Design
| > | Table information.
| > |
| > | Please advise
| > |
| > | Bob Day
| > |
| > |
| > |
| > |
| >
|
|
|
 
Hi Bob,

From the screen shot we can see that you have chosen some fields in the PIN
table. Since fld_Customer_Table_ID field is the primary key of Customer
table, please also try to select this field to see if it works. If it still
doesn't work, I think you have to add the primary key information to the
dataset manually. Sorry for the inconvenience.

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

--------------------
| From: "Bob Day" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Dataset Properties Descrepencies From Table Design
| Date: Tue, 21 Oct 2003 23:57:49 -0500
| Lines: 1443
| 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
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: dhcp16626119.indy.rr.com 24.166.26.119
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:64242
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Every datasource table has a primary key that is an identity column, seed
1,
| increment 1, that is not used for anything in a select statement. The
| primary key from the 2nd table is retrieved. Attached is a screen shot.
|
| I have never seen the message you quote below.
|
| Thanks!
| Bob Day
|
| | > Hi Bob,
| >
| > I followed your steps and reproduced the problem. I found that if there
| are
| > 2 or more tables joined in the SELECT command, you have to select both
| > primary keys of the two table. If not, a message box, which says "The
| > wizard cannot automatically create queries for updating the database
| > because your query does not include some primary key columns. Do you
wish
| > to add primary key columns to your query?", will be show to ask you
| whether
| > to select them. If you choose no, and generate the dataset, the primary
| key
| > information in the dataset will be lost. Please try to select both
primary
| > keys of the 2 table to see if it works.
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "Bob Day" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Dataset Properties Descrepencies From Table Design
| > | Date: Thu, 16 Oct 2003 13:21:38 -0500
| > | Lines: 86
| > | 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
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: dhcp065-029-072-019.indy.rr.com 65.29.72.19
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63791
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | No, here is the reason:
| > | If a DataAdapter in the Component Designer has 1 table used for the
| select
| > | statement, then the Key symbol will show up for the primary key under
| > | DataSet properties. If there are 2 or more tables used for the select
| > | statement in the DataAdapter, then the key symbol won't show up under
| > | DataSet properties. Not sure exactly why, but it doesn't seem to
affect
| > | anything.
| > |
| > | Thanks
| > | bob
| > |
| > | | > | > Hi Bob,
| > | >
| > | > It seems that you lost the primary key definition in the original
| > dataset
| > | > when generating dataset from a DataAdapter.
| > | >
| > | > Please try to check it you have set the primary key in the database
| > table.
| > | > Because if you didn't set the primary key in database, when
generating
| > | > DataSet with a DataAdapter, VS .net will ask you if you want to
modify
| > the
| > | > original dataset. If you choose yes, it will replace the old dataset
| > | schema
| > | > with the table in MSDE. Since no primary key is set in it, the new
| > | > generated dataset doesn't have a primary key, either.
| > | >
| > | > Does this answer your question? If anything is unclear, please feel
| free
| > | to
| > | > reply to the post.
| > | >
| > | > Kevin Yu
| > | > =======
| > | > "This posting is provided "AS IS" with no warranties, and confers no
| > | > rights."
| > | >
| > | > --------------------
| > | > | From: "Bob Day" <[email protected]>
| > | > | Subject: Dataset Properties Descrepencies From Table Design
| > | > | Date: Thu, 9 Oct 2003 21:37:45 -0500
| > | > | Lines: 25
| > | > | 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
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | > | NNTP-Posting-Host: dhcp065-029-072-239.indy.rr.com 65.29.72.239
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.framework.adonet:63339
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > | > |
| > | > | VS 2003 VB net sql msde...
| > | > |
| > | > | I used Server Explorer, Design Table, to define two tables primary
| > keys
| > | > | identically (i.e. autoincrement, same seed & increment, both
| > clustered,
| > | > | etc.)
| > | > |
| > | > | In Component designer, I create a DataAdapter for each table above
| and
| > | > then
| > | > | generate the dataset adding the tables above to the dataset.
| However,
| > | > when
| > | > | I look at dataset properties (right click on DataSet), one of the
| two
| > | > | primary keys is how I defined it in Design Table above, but the
| other
| > | one
| > | > is
| > | > | not.
| > | > |
| > | > | This problem exists with many other tables, and I can see no
pattern
| > or
| > | > | reason.
| > | > |
| > | > | Is Dataset Properties reporting the wrong information? What is
the
| > | > problem
| > | > | here? I would think this info would be pulled directly from the
| > Design
| > | > | Table information.
| > | > |
| > | > | Please advise
| > | > |
| > | > | Bob Day
| > | > |
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Back
Top