473,749 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create ForeignKeyConst raint?

max

Hello,
I am a newbye, and I'm trying to write a simple application.
I have five tables with three columns; all tables are identical; I need to
change some data in the first table and let VB updates the same data in all
other four tables in the right places.
I know it would be possible by using the ForeignKeyConst raint object. I have
created the tables using the DataSet Visual Tool and I know it doesn't
create any ForeignKeyConst raint obj. I have found many codes examples on it,
but I don't know how to merge the code they in an existing dataset.

Hope somebody help.
Thanks in advance,
Max.

Dec 19 '06
27 3789
Max

"Branco Medeiros" It will always depend on how you generate these IDs (I
must warn you
that there are lots of lines of thought in this matter, every one
claiming to be the definitive one).

Personaly, I prefer having a table's ID/PK as an identity column
managed by the system (an autoincrement column, in Access), . Other
people may prefer to generate the keys themselves. Others still will
prefer to use something completely meaningless, say, a GUID, or
whatever (btw, I am, too, among the ones that think that the PK is
meant *only* to pinpoint a given record, but I prefer using a
light-weight identity column for that).

Autoincrement IDs are completely ruled out, for you. Because they're
managed by the DB engine, as soon as you have a situation with, say,
three visits only, the two other tables will become out of synch with
the other three. And it will only get worse after that.
Probably I cannot explain as I'd like. I think autoID is ok for me, because
the five tables must be changed independently from the rest of the
application. The visit tables, called tblPrest1... tblPrest5 (formed by
three columns: ID, Price, and type of visit) are just like a collection of
about 70 records. I mean, I have a menu--->tools--->Change visit table; it
loads a form with the first table; I make all the changes on it, then save
on the binding navigator. At this point, changes must be reflected on the
other four tables.
Next, when I want to open the Visit form, which writes in the Visit table, I
see my five drop down combobox, showing all the records loaded from the
visit table; next, I choose the type of visit, choose how many visits has
been made to that patient by clicking in combobox and leaving the other
combobox blank if visits are < 5, choose date, patient, doctor and stop.
Saving now writes a new record in the Visit table, which has an ID
independent from the other tables.
Thanks for your patience.
>
GUIDs are ruled out also, because, while autoincrement IDs are local to
each table, GUIDs are globally unique among every table, so you can't
have the same GUID for different tables (or so it seems. Forgive me if
I'm mistaken).

Finally, your only choice seems to be to generate your own keys, or
have a mix of tables with hand-made keys and one of the tables with
auto-generated keys (but which one?). Hand generated IDs have their
charm, but have some caveats. Most importantly, their generation logic
is left to the user, instead of remaining hidden inside the DB, and
this may give rise to inconsistencies and, ultimately, warts,
dizzyness, loss of sexual performance, the hell on earth... (=))) you
see I'm *a little* biased, here).
>About the visit pricing: there are more than 70 different type of medical
visits, and each one has a price.
So in a row, I have:
VisitID;
Price;
VisitType.
Just three columns.

Is this the table with information about each type of visit?
>If the boss decides to change the prices of, for i.e., 45 type of medical
visits, the changes must reflect to the other four tables.

Forgive my dumbness: I still don't get it. Are these prices supposed to
change (if they ever do) for a given visit, only? Or would they change
for a whole category of visits? Or, still, would the prices change only
for a given day (a Christmass promo, for instance =))) ?
>More over these 'famous' five tables, there are only three more tables:
The Patients table (just ID, and name and surname);
The Doctors table (just ID, and name and surname);
The Visit table (called by a form) would consist of:
VisitID;
Date;
Patient name;
VisitType 1...VisitType 5 (combo box; if there are less than 5 visits,
the
other combo box will be blank);
Doctor's name.

That's it.
I just need to change the Price column in one table, and make
automaticall y
the changes (update, delete or insert) in the other four tables.
It sounds simple...
<snip>

It seems you want the price to be the same for all the visits of a
given patient in a given day.

Idealy, this would call for a master/detail relation:

Visit table: VisitID, PatientID, Price, Date

VisitDetail table: VisitDetailID, VisitID (the FK), VisitType, DoctorID
Alternatively (oh, the blasphemy!), you could have:

VisitID, PatientID, Price, Date, Visit1Type, Visit1Doctor, ... ,
Visit5Type, Visit5Doctor

HTH.

Regards,

Branco.

Dec 27 '06 #21
Max wrote:
<snip>
Probably I cannot explain as I'd like.
No problem. We'll eventually get there, I hope.
I think autoID is ok for me, because
the five tables must be changed independently from the rest of the
application. The visit tables, called tblPrest1... tblPrest5 (formed by
three columns: ID, Price, and type of visit) are just like a collection of
about 70 records. I mean, I have a menu--->tools--->Change visit table; it
loads a form with the first table; I make all the changes on it, then save
on the binding navigator. At this point, changes must be reflected on the
other four tables.
<snip>

The only way I can think of to keep these tables in synch without
having to deal with a logic nightmare is to truncate and overwrite the
other four tables as soon as you finish editing the first one. It's a
long time since I used Access, so I'm not familiar with its current SQL
capabilities, but it would be something like this:

DELETE * FROM tblPrest2;
INSERT INTO tblPrest2
SELECT * FROM tblPrest1;
...
DELETE * FROM tblPrest5;
INSERT INTO tblPrest5
SELECT * FROM tblPrest1;

For this to work, the IDs of tables tblPrest2...tbl Prest5 can't be
autoincrement, but just regular ints (or so I suppose. You'd need to
perform some tests). Besides, I seem to recall that Access doesn't
allow multiple statements in a SQL command (I hope I'm wrong). If this
is the case, then you'll have to issue the commands *one by one*... =P

So, after having table tblPrest1 updated, this is the kind of code
you'd have to use to synchronize the tables:

<aircode>
'Assuming an *open* OleDbConnection Con

Dim Tables() As String = New String() { _
"tblPrest2" , "tblPrest3" , "tblPrest4" , "tblPrest5" }

Using Cmd As New OleDb.OleDbComm and()
Cmd.Connection = Con
For Each Table As String In Tables
Cmd.CommandText = "DELETE * FROM " & Table
Cmd.ExecuteNonQ uery()
Cmd.CommandText = "INSERT INTO " & Table _
& " SELECT * FROM tblPrest1"
Cmd.ExecuteNonQ uery()
Next
End Using
</aircode>

And it can only become uglier than this (or so it seems, given my
limited knowledge).

Another way to keep the tables in synch is quite obvious (don't laugh,
please): instead of having five tables, create just *one* table and
have other four views (or "queries" in Access parlance) mapping to the
first (and only) table:

tblPrest1: ID, Price, VisitType

tblPrest2 ... tblPrest5: four select queries created in Access with the
following SQL:
"SELECT * FROM tblPrest1"

This way you'd never have to update those "tables", and they'll be
permanently in synch. =)

HTH.

Regards,

Branco.

Dec 27 '06 #22
Max,

I really don't understand why you want 5 tables of the same rows instead of
one table with indified rows for each dokter, why are you doing that?

Cor

"Max" <no****@devnull .spamcop.netsch reef in bericht
news:45******** *************@n ews.tiscali.it. ..
>
"Branco Medeiros" It will always depend on how you generate these IDs (I
must warn you
>that there are lots of lines of thought in this matter, every one
claiming to be the definitive one).

Personaly, I prefer having a table's ID/PK as an identity column
managed by the system (an autoincrement column, in Access), . Other
people may prefer to generate the keys themselves. Others still will
prefer to use something completely meaningless, say, a GUID, or
whatever (btw, I am, too, among the ones that think that the PK is
meant *only* to pinpoint a given record, but I prefer using a
light-weight identity column for that).

Autoincremen t IDs are completely ruled out, for you. Because they're
managed by the DB engine, as soon as you have a situation with, say,
three visits only, the two other tables will become out of synch with
the other three. And it will only get worse after that.

Probably I cannot explain as I'd like. I think autoID is ok for me,
because the five tables must be changed independently from the rest of the
application. The visit tables, called tblPrest1... tblPrest5 (formed by
three columns: ID, Price, and type of visit) are just like a collection of
about 70 records. I mean, I have a menu--->tools--->Change visit table; it
loads a form with the first table; I make all the changes on it, then save
on the binding navigator. At this point, changes must be reflected on the
other four tables.
Next, when I want to open the Visit form, which writes in the Visit table,
I see my five drop down combobox, showing all the records loaded from the
visit table; next, I choose the type of visit, choose how many visits has
been made to that patient by clicking in combobox and leaving the other
combobox blank if visits are < 5, choose date, patient, doctor and stop.
Saving now writes a new record in the Visit table, which has an ID
independent from the other tables.
Thanks for your patience.
>>
GUIDs are ruled out also, because, while autoincrement IDs are local to
each table, GUIDs are globally unique among every table, so you can't
have the same GUID for different tables (or so it seems. Forgive me if
I'm mistaken).

Finally, your only choice seems to be to generate your own keys, or
have a mix of tables with hand-made keys and one of the tables with
auto-generated keys (but which one?). Hand generated IDs have their
charm, but have some caveats. Most importantly, their generation logic
is left to the user, instead of remaining hidden inside the DB, and
this may give rise to inconsistencies and, ultimately, warts,
dizzyness, loss of sexual performance, the hell on earth... (=))) you
see I'm *a little* biased, here).
>>About the visit pricing: there are more than 70 different type of
medical
visits, and each one has a price.
So in a row, I have:
VisitID;
Price;
VisitType.
Just three columns.

Is this the table with information about each type of visit?
>>If the boss decides to change the prices of, for i.e., 45 type of
medical
visits, the changes must reflect to the other four tables.

Forgive my dumbness: I still don't get it. Are these prices supposed to
change (if they ever do) for a given visit, only? Or would they change
for a whole category of visits? Or, still, would the prices change only
for a given day (a Christmass promo, for instance =))) ?
>>More over these 'famous' five tables, there are only three more tables:
The Patients table (just ID, and name and surname);
The Doctors table (just ID, and name and surname);
The Visit table (called by a form) would consist of:
VisitID;
Date;
Patient name;
VisitType 1...VisitType 5 (combo box; if there are less than 5 visits,
the
other combo box will be blank);
Doctor's name.

That's it.
I just need to change the Price column in one table, and make
automatical ly
the changes (update, delete or insert) in the other four tables.
It sounds simple...
<snip>

It seems you want the price to be the same for all the visits of a
given patient in a given day.

Idealy, this would call for a master/detail relation:

Visit table: VisitID, PatientID, Price, Date

VisitDetail table: VisitDetailID, VisitID (the FK), VisitType, DoctorID
Alternativel y (oh, the blasphemy!), you could have:

VisitID, PatientID, Price, Date, Visit1Type, Visit1Doctor, ... ,
Visit5Type, Visit5Doctor

HTH.

Regards,

Branco.


Dec 27 '06 #23
Max
Cor,
as you may have understood, I'm really at the beginning with ado.net and
db's in vb. If the suggestion of Branco works fine, I would be very happy to
forget about FK and company; anyway, now, I'd like to understand how this
issue could be solved using five tables...
I'm learning, and I appreciate all of your suggestions.
I'll let you know.

"Cor Ligthert [MVP]" <no************ @planet.nlha scritto nel messaggio
news:Ow******** ********@TK2MSF TNGP04.phx.gbl. ..
Max,

I really don't understand why you want 5 tables of the same rows instead
of one table with indified rows for each dokter, why are you doing that?

Cor

"Max" <no****@devnull .spamcop.netsch reef in bericht
news:45******** *************@n ews.tiscali.it. ..
>>
"Branco Medeiros" It will always depend on how you generate these IDs
(I must warn you
>>that there are lots of lines of thought in this matter, every one
claiming to be the definitive one).

Personaly, I prefer having a table's ID/PK as an identity column
managed by the system (an autoincrement column, in Access), . Other
people may prefer to generate the keys themselves. Others still will
prefer to use something completely meaningless, say, a GUID, or
whatever (btw, I am, too, among the ones that think that the PK is
meant *only* to pinpoint a given record, but I prefer using a
light-weight identity column for that).

Autoincreme nt IDs are completely ruled out, for you. Because they're
managed by the DB engine, as soon as you have a situation with, say,
three visits only, the two other tables will become out of synch with
the other three. And it will only get worse after that.

Probably I cannot explain as I'd like. I think autoID is ok for me,
because the five tables must be changed independently from the rest of
the application. The visit tables, called tblPrest1... tblPrest5 (formed
by three columns: ID, Price, and type of visit) are just like a
collection of about 70 records. I mean, I have a menu--->tools--->Change
visit table; it loads a form with the first table; I make all the changes
on it, then save on the binding navigator. At this point, changes must be
reflected on the other four tables.
Next, when I want to open the Visit form, which writes in the Visit
table, I see my five drop down combobox, showing all the records loaded
from the visit table; next, I choose the type of visit, choose how many
visits has been made to that patient by clicking in combobox and leaving
the other combobox blank if visits are < 5, choose date, patient, doctor
and stop. Saving now writes a new record in the Visit table, which has an
ID independent from the other tables.
Thanks for your patience.
>>>
GUIDs are ruled out also, because, while autoincrement IDs are local to
each table, GUIDs are globally unique among every table, so you can't
have the same GUID for different tables (or so it seems. Forgive me if
I'm mistaken).

Finally, your only choice seems to be to generate your own keys, or
have a mix of tables with hand-made keys and one of the tables with
auto-generated keys (but which one?). Hand generated IDs have their
charm, but have some caveats. Most importantly, their generation logic
is left to the user, instead of remaining hidden inside the DB, and
this may give rise to inconsistencies and, ultimately, warts,
dizzyness, loss of sexual performance, the hell on earth... (=))) you
see I'm *a little* biased, here).

About the visit pricing: there are more than 70 different type of
medical
visits, and each one has a price.
So in a row, I have:
VisitID;
Price;
VisitType.
Just three columns.

Is this the table with information about each type of visit?

If the boss decides to change the prices of, for i.e., 45 type of
medical
visits, the changes must reflect to the other four tables.

Forgive my dumbness: I still don't get it. Are these prices supposed to
change (if they ever do) for a given visit, only? Or would they change
for a whole category of visits? Or, still, would the prices change only
for a given day (a Christmass promo, for instance =))) ?

More over these 'famous' five tables, there are only three more tables:
The Patients table (just ID, and name and surname);
The Doctors table (just ID, and name and surname);
The Visit table (called by a form) would consist of:
VisitID;
Date;
Patient name;
VisitType 1...VisitType 5 (combo box; if there are less than 5 visits,
the
other combo box will be blank);
Doctor's name.

That's it.
I just need to change the Price column in one table, and make
automaticall y
the changes (update, delete or insert) in the other four tables.
It sounds simple...
<snip>

It seems you want the price to be the same for all the visits of a
given patient in a given day.

Idealy, this would call for a master/detail relation:

Visit table: VisitID, PatientID, Price, Date

VisitDetail table: VisitDetailID, VisitID (the FK), VisitType, DoctorID
Alternative ly (oh, the blasphemy!), you could have:

VisitID, PatientID, Price, Date, Visit1Type, Visit1Doctor, ... ,
Visit5Type, Visit5Doctor

HTH.

Regards,

Branco.



Dec 27 '06 #24
Max
I want to try both your suggestions and I'll let you know...

"Branco Medeiros" <br************ *@gmail.comha scritto nel messaggio
news:11******** **************@ h40g2000cwb.goo glegroups.com.. .
Max wrote:
<snip>
>Probably I cannot explain as I'd like.

No problem. We'll eventually get there, I hope.
>I think autoID is ok for me, because
the five tables must be changed independently from the rest of the
application. The visit tables, called tblPrest1... tblPrest5 (formed by
three columns: ID, Price, and type of visit) are just like a collection
of
about 70 records. I mean, I have a menu--->tools--->Change visit table;
it
loads a form with the first table; I make all the changes on it, then
save
on the binding navigator. At this point, changes must be reflected on the
other four tables.
<snip>

The only way I can think of to keep these tables in synch without
having to deal with a logic nightmare is to truncate and overwrite the
other four tables as soon as you finish editing the first one. It's a
long time since I used Access, so I'm not familiar with its current SQL
capabilities, but it would be something like this:

DELETE * FROM tblPrest2;
INSERT INTO tblPrest2
SELECT * FROM tblPrest1;
...
DELETE * FROM tblPrest5;
INSERT INTO tblPrest5
SELECT * FROM tblPrest1;

For this to work, the IDs of tables tblPrest2...tbl Prest5 can't be
autoincrement, but just regular ints (or so I suppose. You'd need to
perform some tests). Besides, I seem to recall that Access doesn't
allow multiple statements in a SQL command (I hope I'm wrong). If this
is the case, then you'll have to issue the commands *one by one*... =P

So, after having table tblPrest1 updated, this is the kind of code
you'd have to use to synchronize the tables:

<aircode>
'Assuming an *open* OleDbConnection Con

Dim Tables() As String = New String() { _
"tblPrest2" , "tblPrest3" , "tblPrest4" , "tblPrest5" }

Using Cmd As New OleDb.OleDbComm and()
Cmd.Connection = Con
For Each Table As String In Tables
Cmd.CommandText = "DELETE * FROM " & Table
Cmd.ExecuteNonQ uery()
Cmd.CommandText = "INSERT INTO " & Table _
& " SELECT * FROM tblPrest1"
Cmd.ExecuteNonQ uery()
Next
End Using
</aircode>

And it can only become uglier than this (or so it seems, given my
limited knowledge).

Another way to keep the tables in synch is quite obvious (don't laugh,
please): instead of having five tables, create just *one* table and
have other four views (or "queries" in Access parlance) mapping to the
first (and only) table:

tblPrest1: ID, Price, VisitType

tblPrest2 ... tblPrest5: four select queries created in Access with the
following SQL:
"SELECT * FROM tblPrest1"

This way you'd never have to update those "tables", and they'll be
permanently in synch. =)

HTH.

Regards,

Branco.

Dec 27 '06 #25
Max

"Max" <no****@devnull .spamcop.netwro te:
>I want to try both your suggestions and I'll let you know...
>"Branco Medeiros" <br************ *@gmail.comwrot e:
<snip>
>The only way I can think of to keep these tables in synch without
having to deal with a logic nightmare is to truncate and overwrite the
other four tables as soon as you finish editing the first one. It's a
long time since I used Access, so I'm not familiar with its current SQL
capabilities , but it would be something like this:

DELETE * FROM tblPrest2;
INSERT INTO tblPrest2
SELECT * FROM tblPrest1;
...
DELETE * FROM tblPrest5;
INSERT INTO tblPrest5
SELECT * FROM tblPrest1;

For this to work, the IDs of tables tblPrest2...tbl Prest5 can't be
autoincremen t, but just regular ints (or so I suppose. You'd need to
perform some tests). Besides, I seem to recall that Access doesn't
allow multiple statements in a SQL command (I hope I'm wrong). If this
is the case, then you'll have to issue the commands *one by one*... =P

So, after having table tblPrest1 updated, this is the kind of code
you'd have to use to synchronize the tables:

<aircode>
'Assuming an *open* OleDbConnection Con

Dim Tables() As String = New String() { _
"tblPrest2" , "tblPrest3" , "tblPrest4" , "tblPrest5" }

Using Cmd As New OleDb.OleDbComm and()
Cmd.Connection = Con
For Each Table As String In Tables
Cmd.CommandText = "DELETE * FROM " & Table
Cmd.ExecuteNonQ uery()
Cmd.CommandText = "INSERT INTO " & Table _
& " SELECT * FROM tblPrest1"
Cmd.ExecuteNonQ uery()
Next
End Using
</aircode>

And it can only become uglier than this (or so it seems, given my
limited knowledge).
IT WORKS! It's GREAT for all five tables in one step!
>Another way to keep the tables in synch is quite obvious (don't laugh,
please): instead of having five tables, create just *one* table and
have other four views (or "queries" in Access parlance) mapping to the
first (and only) table:

tblPrest1: ID, Price, VisitType

tblPrest2 ... tblPrest5: four select queries created in Access with the
following SQL:
"SELECT * FROM tblPrest1"

This way you'd never have to update those "tables", and they'll be
permanently in synch. =)

HTH.

Regards,

Branco.
I'm gonna try also this (more elegant) method, and let you know.
Thanks a lot!
Dec 27 '06 #26
Max wrote:
<snip>
Next, when I want to open the Visit form, which writes in the Visit table, I
see my five drop down combobox, showing all the records loaded from the
visit table; next, I choose the type of visit, choose how many visits has
been made to that patient by clicking in combobox and leaving the other
combobox blank if visits are < 5, choose date, patient, doctor and stop.
Saving now writes a new record in the Visit table, which has an ID
independent from the other tables.
<snip>

Oh, *now* I got it!

You don't need five tables. You only need one (tblPrest1).

I suppose you're working with the Visits table in record view (as
opposed to grid view).

If this is the case, open the Visit form and drag the tblPrest1 table
from the Data Sources panel *over* the combo box of the VisitType1
field that is in the form. Then select the combo box and set the
DisplayMember property to the name of the field from tblPrest1 you want
to be displayed (probably the visit type). Set the ValueMember property
to the name of the field from tblPrest1 that you want to *store*
(probably its ID).

Do exactly the same thing with the other four Combos: drag *tblPrest1*
from the data sources panel over the combo box, set the fields, etc.

You're all set to go.

HTH.

Regards,

Branco.

Dec 27 '06 #27
Max
Thanks Branco,
it works! But it also works your suggest in your previous post about SQL
statements to Access db:

*************** *************** ******
'Assuming an *open* OleDbConnection Con

Dim Tables() As String = New String() { _
"tblPrest2" , "tblPrest3" , "tblPrest4" , "tblPrest5" }

Using Cmd As New OleDb.OleDbComm and()
Cmd.Connection = Con
For Each Table As String In Tables
Cmd.CommandText = "DELETE * FROM " & Table
Cmd.ExecuteNonQ uery()
Cmd.CommandText = "INSERT INTO " & Table _
& " SELECT * FROM tblPrest1"
Cmd.ExecuteNonQ uery()
Next
End Using
*************** *************** ******

By now, I don't want know anymore else about FK, because I risk to be
involved in the patient table of my db, and in a 'psychiatric' medical
visit... :)))
Thanks a lot, and happy to know there are so many nice people, helping
'absolute beginner' as mine...
You'll see me in my next issue! :)
Max

"Branco Medeiros" <br************ *@gmail.comha scritto nel messaggio
news:11******** **************@ 48g2000cwx.goog legroups.com...
Max wrote:
<snip>
>Next, when I want to open the Visit form, which writes in the Visit
table, I
see my five drop down combobox, showing all the records loaded from the
visit table; next, I choose the type of visit, choose how many visits has
been made to that patient by clicking in combobox and leaving the other
combobox blank if visits are < 5, choose date, patient, doctor and stop.
Saving now writes a new record in the Visit table, which has an ID
independent from the other tables.
<snip>

Oh, *now* I got it!

You don't need five tables. You only need one (tblPrest1).

I suppose you're working with the Visits table in record view (as
opposed to grid view).

If this is the case, open the Visit form and drag the tblPrest1 table
from the Data Sources panel *over* the combo box of the VisitType1
field that is in the form. Then select the combo box and set the
DisplayMember property to the name of the field from tblPrest1 you want
to be displayed (probably the visit type). Set the ValueMember property
to the name of the field from tblPrest1 that you want to *store*
(probably its ID).

Do exactly the same thing with the other four Combos: drag *tblPrest1*
from the data sources panel over the combo box, set the fields, etc.

You're all set to go.

HTH.

Regards,

Branco.

Dec 28 '06 #28

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

Similar topics

4
4418
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create shortcut to my program/utility (2) Entry in Windows' Start --> Program Menu. Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2) MYPROGRAM_INSTALLER. MYPROGRAM is a "Windows Application". MYPROGRAM_INSTALLER is a "SetUp Wizard"...
1
2125
by: Agnes | last post by:
Please be kind to take a look dsSeaInvInfo.Clear() daSeaInvInfo.SelectCommand = New SqlCommand daSeaInvInfo.SelectCommand.Connection = conSea daSeaInvInfo.TableMappings.Add("Table", "invoiceheader") daSeaInvInfo.SelectCommand.CommandText = "select * from invoiceheader" daSeaInvInfo.Fill(dsSeaInvInfo, "invoiceheader") daSeaInvInfo.SelectCommand.CommandText = "select * from invoicedetail "
1
2655
by: jaYPee | last post by:
I have created 3 sqldataadapter. each adapter.selectcommand has a parameter. I have added a textbox to supply a value for each parameter. My problem is when I press enter the second time to fire up the keypress event from the textbox I recieved this error in datagrid object "ForeignKeyConstraint StudentsSchYrSem requires the child key values (21000013) to exist in the parent table" I'm wondering before if I change the value of that...
1
1709
by: David A. Osborn | last post by:
I keep getting the following message when adding a new record to a database that has two tables. On table is a parent to the other. I am adding a new parent record that has child records and I get the following: ForeignKeyConstraint drtblCDstblSongs requires the child key value(9) to exist in the parent table. Do you want to correct the value? Is there a way I can just turn this off since with my program the only way to add a child...
13
10143
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the parent table. ----------------------------
18
2719
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html In this post, I'm especially soliciting review of Carl Banks's point (now discussed under Open Issues) which asks if it would be better to have the create statement translated into:
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.