Click here to Skip to main content
15,895,557 members
Home / Discussions / C#
   

C#

 
QuestionGetMembers and COM Pin
dcadenas7-Jun-06 9:00
dcadenas7-Jun-06 9:00 
QuestionUpdate progress bar from a separate project Pin
snorkie7-Jun-06 8:34
professionalsnorkie7-Jun-06 8:34 
AnswerRe: Update progress bar from a separate project Pin
Stefan Troschuetz7-Jun-06 10:01
Stefan Troschuetz7-Jun-06 10:01 
QuestionAborting / Killing Threads Pin
MrEyes7-Jun-06 8:08
MrEyes7-Jun-06 8:08 
AnswerRe: Aborting / Killing Threads Pin
Ed.Poore7-Jun-06 10:45
Ed.Poore7-Jun-06 10:45 
QuestionMDI form child closing [modified] Pin
ak877-Jun-06 6:51
ak877-Jun-06 6:51 
AnswerRe: MDI form child closing [modified] Pin
Josh Smith7-Jun-06 9:16
Josh Smith7-Jun-06 9:16 
QuestionConstraints [modified] Pin
kjosh7-Jun-06 6:48
kjosh7-Jun-06 6:48 
Hi,
I have the small doubt,I created a table Author in oracle and i put primary key constraint on authorid field.And i created another table Article and foreign key constaraint placed on this table's authorid.Now iam inserting data into these two tables through front end.
My doubt is why we have to create

Dim pk(1) As DataColumn

pk(0) = ds.Tables(0).Columns("authid")

ds.Tables("authors").PrimaryKey = pk
This is for primary key.

The below is for foreign key:

Dim fk As ForeignKeyConstraint

fk = New ForeignKeyConstraint("fk", ds.Tables(0).Columns("authid"),

ds.Tables(1).Columns("authid"))

fk.DeleteRule = Rule.Cascade

fk.UpdateRule = Rule.Cascade

ds.Tables(1).Constraints.Add(fk)

ds.EnforceConstraints = True

with out creating this constraints iam getting exception "sys... violated" when iam trying to insert duplicate values.
Then what is the use of above code and when the code will be useful.

Thanks in advance.

-- modified at 9:49 Friday 9th June, 2006
AnswerRe: Constraints Pin
dreynglar8-Jun-06 7:05
dreynglar8-Jun-06 7:05 
QuestionC#/SQL Question Pin
leckey7-Jun-06 6:27
leckey7-Jun-06 6:27 
AnswerRe: C#/SQL Question Pin
NaNg152417-Jun-06 6:50
NaNg152417-Jun-06 6:50 
GeneralRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 8:13
Colin Angus Mackay7-Jun-06 8:13 
AnswerRe: C#/SQL Question Pin
Gerald Schwab7-Jun-06 6:53
Gerald Schwab7-Jun-06 6:53 
GeneralRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 8:14
Colin Angus Mackay7-Jun-06 8:14 
GeneralRe: C#/SQL Question Pin
Gerald Schwab9-Jun-06 7:07
Gerald Schwab9-Jun-06 7:07 
GeneralRe: C#/SQL Question Pin
Colin Angus Mackay9-Jun-06 11:20
Colin Angus Mackay9-Jun-06 11:20 
AnswerRe: C#/SQL Question Pin
malikjhangirahmed@hotmail.com7-Jun-06 7:21
malikjhangirahmed@hotmail.com7-Jun-06 7:21 
GeneralRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 8:14
Colin Angus Mackay7-Jun-06 8:14 
AnswerRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 8:11
Colin Angus Mackay7-Jun-06 8:11 
QuestionRe: C#/SQL Question Pin
leckey7-Jun-06 8:15
leckey7-Jun-06 8:15 
AnswerRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 8:29
Colin Angus Mackay7-Jun-06 8:29 
GeneralRe: C#/SQL Question Pin
leckey7-Jun-06 8:36
leckey7-Jun-06 8:36 
GeneralRe: C#/SQL Question Pin
leckey7-Jun-06 8:55
leckey7-Jun-06 8:55 
GeneralRe: C#/SQL Question Pin
Josh Smith7-Jun-06 9:01
Josh Smith7-Jun-06 9:01 
GeneralRe: C#/SQL Question Pin
Colin Angus Mackay7-Jun-06 9:03
Colin Angus Mackay7-Jun-06 9:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.