troubleshooting Question

Insert Error Still

Avatar of jjc9809
jjc9809 asked on
Visual Basic.NET
2 Comments1 Solution232 ViewsLast Modified:
I have an error when the Insert is read:

My coding:  Dim strQuery As String = "Insert Into [PersonOfInterest] ([PK_DriverLicenseID_vch], [IssuingState_vch], [Priority_vch], [FirstName_vch], [MiddleInitial_vch], [LastName_vch], [FK_Suffix_ID_vch], [PhysicalAddress1_vch], [PhysicalAddress2_vch], [PhysicalCity_vch], [FK_CountyID_vch], [FK_PhysicalState_vch], [PhysicalZip_ch], [DOBMonth_ch], [DOBDay_ch], [DOBYear_ch], [SSN1_ch], [SSN2_ch], [SSN3_ch], [FK_RaceID_vch], [HeightFt_ch], [HeightIn_ch], [FK_HairColor_vch], [FK_EyeColor_vch], [Employer_vch], [EmployerAddress_vch], [EmployerCity_vch], [EmployerState_vch], [EmployerZip_ch], [SchoolAttending_vch], [SchoolAddress_vch], [SchoolCity_vch], [SchoolState_vch], [SchoolZip_ch], [HomePhone1_ch], [HomePhone2_ch], [HomePhone3_ch], [MobilePhone1_ch], [MobilePhone2_ch], [MobilePhone3_ch], [OtherPhone1_ch], [OtherPhone2_ch], [OtherPhone3_ch], [FBINumber_vch], [Alias1_vch], [Alias2_vch], [Alias3_vch], [Alias4_vch], [Alias5_vch], [FK_IntelligenceType_vch], [ContactMonth_ch], [ContactDay_ch], [ContactYear_ch], [DateTimeAdded_vch], [UserAdded_vch], [DateTimeModified_vch], [UserModified_vch], [Weight_ch]) VALUES (@PK_DriverLicenseID_vch, @IssuingState_vch, @Priority_vch, @PhysicalCity_vch, @FK_CountyID_vch, @FK_PhysicalState_vch, @PhysicalZip_ch, @DOBMonth_ch, @DOBDay_ch], @DOBYear_ch, @SSN1_ch, @SSN2_ch, @SSN3_ch, @FK_RaceID_vch, @HeightFt_ch, @HeightIn_ch , @FK_HairColor_vch, @FK_EyeColor_vch, @Employer_vch, @EmployerAddress_vch, @EmployerCity_vch , @EmployerState_vch, @EmployerZip_ch, @SchoolAttending_vch, @SchoolAddress_vch, @SchoolCity_vch, @SchoolState_vch, @SchoolZip_ch, @HomePhone1_ch, @HomePhone2_ch, @HomePhone3_ch, @MobilePhone1_ch, @MobilePhone2_ch, @MobilePhone3_ch, @OtherPhone1_ch, @OtherPhone2_ch, @OtherPhone3_ch, @FBINumber_vch, @Alias1_vch, @Alias2_vch, @Alias3_vch, @Alias4_vch, @Alias5_vch, @FK_IntelligenceType_vch, @ContactMonth_ch, @ContactDay_ch, @ContactYear_ch, @FirstName_vch, @MiddleInitial_vch, @LastName_vch, @FK_Suffix_ID_vch, @PhysicalAddress1_vch, @PhysicalAddress2_vch, @DateTimeAdded_vch, @UserAdded_vch, @DateTimeModified_vch, @UserModified_vch, @Weight_ch); SELECT SCOPE_IDENTITY();"

The error appears on this coding and stops:

'Open the connection

        'Execute the query
        IntID = Convert.ToInt32(myCommand.ExecuteScalar())

        'Brings the ID Field in
        Me.ID.Text = IntID
        QueryResult.Text = "Record '" + IntID.ToString() + "' was saved successfully!"

There is an incorrect syntax on "]"

I can't see the problem.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros