Click here to Skip to main content
15,886,664 members
Home / Discussions / Database
   

Database

 
Questionupdate/delete error "Could not determine which columns uniquely identify the rows for" Pin
roithi19-Feb-07 18:24
roithi19-Feb-07 18:24 
AnswerRe: update/delete error "Could not determine which columns uniquely identify the rows for" Pin
andyharman20-Feb-07 0:10
professionalandyharman20-Feb-07 0:10 
QuestionHelp Me:Can we select sum of 2 columns in one select statement? Pin
priya_p23319-Feb-07 17:41
priya_p23319-Feb-07 17:41 
AnswerRe: Help Me:Can we select sum of 2 columns in one select statement? Pin
K.P.Kannan19-Feb-07 18:26
K.P.Kannan19-Feb-07 18:26 
AnswerRe: Help Me:Can we select sum of 2 columns in one select statement? Pin
asithangae19-Feb-07 18:30
asithangae19-Feb-07 18:30 
GeneralRe: Help Me:Can we select sum of 2 columns in one select statement? Pin
asithangae19-Feb-07 18:42
asithangae19-Feb-07 18:42 
Questionparent and child deleting using typed datasets, cascade to delete children Pin
steve_rm19-Feb-07 17:06
steve_rm19-Feb-07 17:06 
QuestionRe: parent and child deleting using typed datasets, cascade to delete children Pin
steve_rm19-Feb-07 19:41
steve_rm19-Feb-07 19:41 
Hello,

I am using foreign key constraints but i can delete the parent but does not delete the children.

My code below:
<br />
    Try<br />
                    'Get the AssemblyID number of the assembly that will be deleted<br />
                    drv = DirectCast(Me.cboAssemblies.SelectedItem, DataRowView)<br />
                    AssemblyID = drv("AssemblyID")<br />
<br />
                    If (Me.DsAssembly.AssembliedEquipment.Constraints.Count > 0) Then<br />
                        Me.DsAssembly.AssembliedEquipment.Constraints.Clear()<br />
                    End If<br />
<br />
                    FK_Assembly = New ForeignKeyConstraint("AssemblyContriant", Me.DsAssembly._Assembly.AssemblyIDColumn, Me.DsAssembly.AssembliedEquipment.AssemblyIDColumn)<br />
                    FK_Assembly.DeleteRule = Rule.SetNull<br />
                    FK_Assembly.UpdateRule = Rule.Cascade<br />
                    FK_Assembly.AcceptRejectRule = AcceptRejectRule.Cascade<br />
<br />
                    Me.DsAssembly.AssembliedEquipment.Constraints.Add(FK_Assembly)<br />
                    Me.DsAssembly.EnforceConstraints = True<br />
<br />
                    'Get the row of data for the assembly that will be deleted<br />
                    datarow = Me.DsAssembly._Assembly.FindByAssemblyID(AssemblyID)<br />
<br />
                    'Delete this row<br />
                    rowsAffected = Me.TA_Assembly_DsAssembly1.Delete(datarow.AssemblyID, datarow.AssemblyName)<br />
<br />
                    If (rowsAffected = 1) Then<br />
                        MessageBox.Show("Assemblied part has been deleted", "Delete Assembly", MessageBoxButtons.OK, MessageBoxIcon.Information)<br />
                    Else<br />
                        MessageBox.Show("Assemblied part cannot be deleted", "Delete Assembly", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
                    End If<br />
<br />
                Catch ex As Exception<br />
                    MessageBox.Show(ex.Message)<br />
                Finally<br />
                    If (Me.DsAssembly.AssembliedEquipment.Constraints.Count > 0) Then<br />
                        Me.DsAssembly.AssembliedEquipment.Constraints.Clear()<br />
                    End If<br />
                End Try<br />


Many thanks if you can help me with this problem.

Steve
QuestionMulti-Column Contains Syntax??? Pin
code-frog19-Feb-07 12:50
professionalcode-frog19-Feb-07 12:50 
AnswerRe: Multi-Column Contains Syntax??? Pin
Krish - KP19-Feb-07 23:38
Krish - KP19-Feb-07 23:38 
GeneralRe: Multi-Column Contains Syntax??? Pin
code-frog20-Feb-07 8:19
professionalcode-frog20-Feb-07 8:19 
QuestionADO.NET book that uses practical application examples Pin
reach4thelasers19-Feb-07 11:18
reach4thelasers19-Feb-07 11:18 
AnswerRe: ADO.NET book that uses practical application examples Pin
firestoper19-Feb-07 12:56
firestoper19-Feb-07 12:56 
AnswerRe: ADO.NET book that uses practical application examples Pin
Rahithi23-Feb-07 2:30
Rahithi23-Feb-07 2:30 
GeneralRe: ADO.NET book that uses practical application examples Pin
reach4thelasers3-Mar-07 12:01
reach4thelasers3-Mar-07 12:01 
Questiondeference between tow types of join Pin
a_yosef19-Feb-07 11:13
a_yosef19-Feb-07 11:13 
AnswerRe: deference between tow types of join Pin
Christian Graus19-Feb-07 11:21
protectorChristian Graus19-Feb-07 11:21 
GeneralRe: deference between tow types of join Pin
a_yosef19-Feb-07 12:15
a_yosef19-Feb-07 12:15 
QuestionWhich DataType? Pin
Sam Heller19-Feb-07 6:16
Sam Heller19-Feb-07 6:16 
AnswerRe: Which DataType? Pin
andyharman19-Feb-07 7:00
professionalandyharman19-Feb-07 7:00 
GeneralRe: Which DataType? Pin
Marcus J. Smith19-Feb-07 8:14
professionalMarcus J. Smith19-Feb-07 8:14 
QuestionBLOB - Document System Pin
alwinSCH19-Feb-07 5:07
alwinSCH19-Feb-07 5:07 
AnswerRe: BLOB - Document System Pin
andyharman19-Feb-07 5:34
professionalandyharman19-Feb-07 5:34 
QuestionCopy Stored Procedure Pin
Gjuviqta19-Feb-07 3:15
Gjuviqta19-Feb-07 3:15 
AnswerRe: Copy Stored Procedure Pin
Mark J. Miller19-Feb-07 9:11
Mark J. Miller19-Feb-07 9:11 

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.