syll 0 Newbie Poster

Hi,
I am trying to download data using a dataset, but I keep getting the error "Failed to enable constraints" On Debug, I get the suggestion 'Relax or turn off constraints in your dataset" refers to "aRow.EmployeeID" my dataset has this query:

select isnull(c.Answer,'') Answer,isnull(b.Comment,'') Comment  from Questions a left join Answers b on a.QuestionID=b.QuestionID
left join AnswerList c on b.AnswerID=c.AnswerID
where QuestionSetID=@QuestionSetID and EmployeeID=@EmployeeID

and the complaining code:

SurveyResults3DataTable = SurveyResults3TableAdapter.GetData(ddlSelQuestionSet.SelectedValue, aRow.EmployeeID)
            For Each SurveyResults3Row In SurveyResults3DataTable.Rows

                For iLoop = 1 To 2
                
                    If Not Delimiter Is Nothing AndAlso (Delimiter.Trim.Length > 0) Then
                        ResultBuilder.Append(Delimiter)
                    End If
                    If iLoop = 1 Then
                        ResultBuilder.Append(SurveyResults3Row.Answer)
                    Else
                        ResultBuilder.Append(SurveyResults3Row.Comment)

                        If Not Delimiter Is Nothing AndAlso (Delimiter.Trim.Length > 0) Then
                            ResultBuilder.Append(Delimiter)
                        End If
                        ResultBuilder.Append(Separator)
                    End If
                    
                Next

How do I remove constraints using the EnforceConstraints=False or which constraint could it be complaining about? Another suggestion from debug mode is "Be sure you are not trying to assign a value to a PK field whose PK already exists.
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.