Q: DataSets and SQL Server
- From: "Geoff" <nodamnspam@xxxxxxxxx>
- Date: Fri, 27 Jan 2006 15:39:50 -0000
Hi
I'm hoping somebody can help me with the following problem that has occurred
to me.
Suppose I have two tables in an SQL Server database. Let's call these tables
A and B. Assume that A has two fields: a primary key and another holding a
string. In table B there are three fields: a primary key, a foreign key
(which links to the primary key in A) and other field holding a string.
Suppose I load these tables into a DataSet. I populate table A with some
rows. For each of these rows I create some rows in B which are linked by the
foreign key to A i.e. there is a one to many relationship between A and B.
Once this is done, I update the DataSet via a DataAdaptor such that these
tables are transferred to the SQL database.
My question is this. As far as I can see, the values in the primary key of A
and the corresponding keys in B will not necessarily be the same in the
DataSet and the SQL database! Do you see what I mean? I can't see how the
relationship specified is still valid after the Update.
Can anybody explain this to me?
Thanks in advance
Geoff
.
- Follow-Ups:
- Re: DataSets and SQL Server
- From: Stephen Howe
- Re: DataSets and SQL Server
- Prev by Date: RE: ADO/ASP timeout issue
- Next by Date: Re: DataSets and SQL Server
- Previous by thread: ADO/ASP timeout issue
- Next by thread: Re: DataSets and SQL Server
- Index(es):
Relevant Pages
- Re: Accesss ADP
... different name, upload it to the server, and when it was finished uploading, ...
so that it would overwrite the original database ... I know that there's a SQL button
somewhere in there. ... It doesn't have to be a primary key - ... (comp.databases.ms-sqlserver) - Re: PostgreSQL
... In general any SQL database will handle all of those things better. ... This
is VERY important ALWAYS make sure you have a PRIMARY key in each ... Having a sever
database engine opens up a lot of options. ... (comp.lang.clarion) - Problem with Response.Redirect
... Here data is added to a database in People ... The primary key is Name.
... Dim l_ColorPreference ... 'Response.Write SQL ... (microsoft.public.inetserver.asp.db) - Re: Schema Anomalies
... Currently your setup only checks for Natural joins (where foreign key ... column
names equal the primary key column names). ... beacuse they would only mean extra overhead
on the database ... The discussions on single culumn tables (AKA lookup tables)
goes long ... (comp.databases) - Re: Row cannot be located for updating
... Do you have primary key in every table affected by delete? ... > way to set
the SQL generation to just use the key? ... >> database. ... >>
The error message you are getting indicates that ADO can not find the ... (borland.public.delphi.database.ado)