Click here to Skip to main content
15,867,986 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: C# and vb.net in same .dll? Pin
Christian Graus21-Jul-09 15:48
protectorChristian Graus21-Jul-09 15:48 
GeneralRe: C# and vb.net in same .dll? Pin
Adam R Harris21-Jul-09 19:03
Adam R Harris21-Jul-09 19:03 
GeneralRe: C# and vb.net in same .dll? Pin
cstrader23222-Jul-09 1:01
cstrader23222-Jul-09 1:01 
QuestionCustom Actions VS2005 Windows Installer Pin
Cory Kimble21-Jul-09 9:35
Cory Kimble21-Jul-09 9:35 
AnswerRe: Custom Actions VS2005 Windows Installer Pin
Jack Vanderhorst27-Jul-09 15:08
Jack Vanderhorst27-Jul-09 15:08 
QuestionVBA Function Calls Pin
Gordon2721-Jul-09 8:00
Gordon2721-Jul-09 8:00 
AnswerRe: VBA Function Calls Pin
David Mujica21-Jul-09 8:16
David Mujica21-Jul-09 8:16 
QuestionFK constraint error when filling parent adaptor with parameterized stored procedure Pin
tcd6721-Jul-09 6:47
tcd6721-Jul-09 6:47 
Hi All, I have an application with a parent table and several child tables that load on startup. The application had been working perfectly until recently. The problem started when I added a filter to fine tune the data that is returned. I'm doing this with a parameterized stored procedure and now receive the dreaded FK constraint error during the initial fill of the child adaptors, after the parent adaptor is filled. Once I clear the error (which is passed out to a message box) the child adaptors will fill and the app works great. Do the stored procedures that fill the child adaptors also need to be parameterized?

I have the relation between the parent\child tables in my dataset set to “Both Relation And Foreign Key Constraint” and “Cascade” on Update\Delete. The filter is a checkedlistbox and all data is returned with sprocs. Only the parent stored procedure has parameters. TblOrganizationTableAdapter is the parent table. Here is my code:

Public Sub btnOrgFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOrgFilter.Click

     'create list that contains the checked items in the org filter checkbox
     Dim orgFilter As New ArrayList
     If clbOrgFilter.CheckedItems.Count <> 0 Then
         Dim X As Integer
         For X = 0 To clbOrgFilter.CheckedItems.Count - 1
             orgFilter.Add(clbOrgFilter.CheckedItems(X))
         Next X
     End If

     'change the list items in the array to thier corresponding org type ID's
     Dim i As Integer
     For i = 0 To orgFilter.Count - 1
         Select Case orgFilter.Item(i)
             Case "Other"
                 orgFilter.Item(i) = "0"
             Case "Prospect"
                 orgFilter.Item(i) = "1"
             Case "Investment"
                 orgFilter.Item(i) = "2"
             Case "Vendor"
                 orgFilter.Item(i) = "3"
             Case "Client"
                 orgFilter.Item(i) = "4"
         End Select
     Next

     'concatenate the array ID's into a comma-delimited string
     Dim result = String.Join(",", orgFilter.ToArray(GetType(String)))

     'load main form with filter result
     Try
         Me.TblOrganizationTableAdapter.FillByOrgType(Me.OrganizationDataSet.tblOrganization, result)
         Me.TblOrgNoteTableAdapter.Fill(Me.OrganizationDataSet.tblOrgNote)
         Me.TblContactTableAdapter.Fill(Me.OrganizationDataSet.tblContact)
         Me.TblOrgAddressTableAdapter.Fill(Me.OrganizationDataSet.tblOrgAddress)
         Me.TblMeetingTableAdapter.Fill(Me.OrganizationDataSet.tblMeeting)
         Me.TblMeetingParticipantTableAdapter.Fill(Me.OrganizationDataSet.tblMeetingParticipant)

     Catch ex As Exception
         MessageBox.Show(ex.ToString)
     End Try

 End Sub

AnswerRe: FK constraint error when filling parent adaptor with parameterized stored procedure Pin
Mycroft Holmes21-Jul-09 17:02
professionalMycroft Holmes21-Jul-09 17:02 
AnswerRe: FK constraint error when filling parent adaptor with parameterized stored procedure Pin
tcd6722-Jul-09 9:53
tcd6722-Jul-09 9:53 
QuestionSubroutine Pin
abcurl21-Jul-09 6:23
abcurl21-Jul-09 6:23 
AnswerRe: Subroutine Pin
Dave Kreskowiak21-Jul-09 8:27
mveDave Kreskowiak21-Jul-09 8:27 
AnswerRe: Subroutine Pin
Christian Graus21-Jul-09 10:22
protectorChristian Graus21-Jul-09 10:22 
AnswerRe: Subroutine Pin
EliottA22-Jul-09 6:07
EliottA22-Jul-09 6:07 
GeneralRe: Subroutine Pin
DoctorMick22-Jul-09 6:22
DoctorMick22-Jul-09 6:22 
QuestionVBA Loop Problem Pin
Dalek Dave21-Jul-09 5:23
professionalDalek Dave21-Jul-09 5:23 
AnswerRe: VBA Loop Problem Pin
DoctorMick21-Jul-09 5:45
DoctorMick21-Jul-09 5:45 
GeneralRe: VBA Loop Problem Pin
Dalek Dave21-Jul-09 6:01
professionalDalek Dave21-Jul-09 6:01 
AnswerRe: VBA Loop Problem Pin
Luc Pattyn21-Jul-09 5:47
sitebuilderLuc Pattyn21-Jul-09 5:47 
GeneralRe: VBA Loop Problem Pin
Dalek Dave21-Jul-09 6:02
professionalDalek Dave21-Jul-09 6:02 
GeneralRe: VBA Loop Problem Pin
Luc Pattyn21-Jul-09 6:09
sitebuilderLuc Pattyn21-Jul-09 6:09 
GeneralRe: VBA Loop Problem Pin
Dalek Dave21-Jul-09 23:33
professionalDalek Dave21-Jul-09 23:33 
QuestionText copy Pin
subdeery21-Jul-09 2:12
subdeery21-Jul-09 2:12 
AnswerRe: Text copy Pin
Tino121-Jul-09 3:35
Tino121-Jul-09 3:35 
GeneralRe: Text copy Pin
subdeery21-Jul-09 4:17
subdeery21-Jul-09 4:17 

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.