Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2461
  • Last Modified:

1000 Point Question: Value was either too large or too small for an Int32.......I have no variable or fields with an Int32 defined.....How do I get this error message

I keep getting this error message when I attempt to write my record to my sql database.

Value was either too large or too small for an Int32

Can anybody tell me where this might be comming from.  Or....how do I set a trap to identify the exact variable it is haveing a problem with.

For the person who answers the question correctly, I will submit the same question again and award another 500 points to that person.


Thanks
Kenny

Here is my code.


Try

                        Dim objConnection6 As SqlConnection = New SqlConnection("server=(local);database=FBISD-TAKS;user id=sa;password=pa55word")
                        Dim objCommand6 As SqlCommand = New SqlCommand
                        objCommand6.Connection = objConnection6
                        objCommand6.CommandText = "Insert Into TaksObjectiveScores " & "(admDate, studentId, teacherIdElaWriting, teacherIdMath, grade, readingObj1Avail, readingObj1Correct, readingObj1Score, readingObj1PF, readingObj2Avail, readingObj2Correct, readingObj2Score, readingObj2PF, readingObj3Avail, readingObj3Correct, readingObj3Score, readingObj3PF, readingObj4Avail, readingObj4Correct, readingObj4Score, readingObj4PF, mathObj1Avail, mathObj1Correct, mathObj1Score, mathObj1PF, mathObj2Avail, mathObj2Correct, mathObj2Score, mathObj2PF, mathObj3Avail, mathObj3Correct, mathObj3Score, mathObj3PF, mathObj4Avail, mathObj4Correct, mathObj4Score, mathObj4PF, mathObj5Avail, mathObj5Correct, mathObj5Score, mathObj5PF, mathObj6Avail, mathObj6Correct, mathObj6Score, mathObj6PF, mathObj7Avail, mathObj7Correct, mathObj7Score, mathObj7PF, mathObj8Avail, mathObj8Correct, mathObj8Score, mathObj8PF, mathObj9Avail, mathObj9Correct, mathObj9Score, mathObj9PF, mathObj10Avail, mathObj10Correct, mathObj10Score, mathObj10PF, socialStudObj1Avail, socialStudObj1Correct, socialStudObj1Score, socialStudObj1PF, socialStudObj2Avail, socialStudObj2Correct, socialStudObj2Score, socialStudObj2PF, socialStudObj3Avail, socialStudObj3Correct, socialStudObj3Score, socialStudObj3PF, socialStudObj4Avail, socialStudObj4Correct, socialStudObj4Score, socialStudObj4PF, socialStudObj5Avail, socialStudObj5Correct, socialStudObj5Score, socialStudObj5PF, scienceObj1Avail, scienceObj1Correct, scienceObj1Score, scienceObj1PF, scienceObj2Avail, scienceObj2Correct, scienceObj2Score, scienceObj2PF, scienceObj3Avail, scienceObj3Correct, scienceObj3Score, scienceObj3PF, scienceObj4Avail, scienceObj4Correct, scienceObj4Score, scienceObj4PF, scienceObj5Avail, scienceObj5Correct, scienceObj5Score, scienceObj5PF, readingObj1PFRaw, readingObj2PFRaw, readingObj3PFRaw, readingObj4PFRaw, mathObj1PFRaw, mathObj2PFRaw, mathObj3PFRaw, mathObj4PFRaw, mathObj5PFRaw, mathObj6PFRaw, mathObj7PFRaw, mathObj8PFRaw, mathObj9PFRaw, mathObj10PFRaw, socStudObj1PFRaw, socStudObj2PFRaw, socStudObj3PFRaw, socStudObj4PFRaw, socStudObj5PFRaw, scienceObj1PFRaw, scienceObj2PFRaw, scienceObj3PFRaw, scienceObj4PFRaw, scienceObj5PFRaw) " & _
                                "VALUES(@oadmDate, @ostudentId, @oteacherIdElaWriting, @oteacherIdMath, @ograde, @oreadingEla10AvailableObj1, @oreadingElaObjScoresArray1, @oreadingEla10AvailableObj1Score, @oreadingElaObj101ObjectiveGrade, @oreadingEla10AvailableObj2, @oreadingElaObjScoresArray2, @oreadingEla10AvailableObj2Score, @oreadingElaObj102ObjectiveGrade, @oreadingEla10AvailableObj3, @oreadingElaObjScoresArray3, @oreadingEla10AvailableObj3Score, @oreadingElaObj103ObjectiveGrade, @oreadingEla10AvailableObj4, @oreadingElaObjScoresArray4, @oreadingEla10AvailableObj4Score, @oreadingElaObj104ObjectiveGrade, @math10AvailableObj1, @omathObjScoresArray, @omath10AvailableObj1Score, @oMathObj101ObjectiveGrade, @math10AvailableObj2, @omathObjScoresArray2, @omath10AvailableObj2Score, @oMathObj102ObjectiveGrade, @math10AvailableObj3, @omathObjScoresArray3, @omath10AvailableObj3Score, @oMathObj103ObjectiveGrade, @math10AvailableObj4, @omathObjScoresArray4, @omath10AvailableObj4Score, @oMathObj104ObjectiveGrade, @math10AvailableObj5, @omathObjScoresArray5, @omath10AvailableObj5Score, @oMathObj105ObjectiveGrade, @math10AvailableObj6, @omathObjScoresArray6, @omath10AvailableObj6Score, @oMathObj106ObjectiveGrade, @math10AvailableObj7, @omathObjScoresArray7, @omath10AvailableObj7Score, @oMathObj107ObjectiveGrade, @math10AvailableObj8, @omathObjScoresArray8, @omath10AvailableObj8Score, @oMathObj108ObjectiveGrade, @math10AvailableObj9, @omathObjScoresArray9, @omath10AvailableObj9Score, @oMathObj109ObjectiveGrade, @math10AvailableObj10, @omathObjScoresArray10, @omath10AvailableObj10Score, @oMathObj1010ObjectiveGrade, @oSocialStud10AvailableObj1, @oSocialStudObjScoresArray1, @oSocialStud10AvailableObj1Score, @oSocialStudObj101ObjectiveGrade, @oSocialStud10AvailableObj2, @oSocialStudObjScoresArray2, @oSocialStud10AvailableObj2Score, @oSocialStudObj102ObjectiveGrade, @oSocialStud10AvailableObj3, @oSocialStudObjScoresArray3, @oSocialStud10AvailableObj3Score, @oSocialStudObj103ObjectiveGrade, @oSocialStud10AvailableObj4, @oSocialStudObjScoresArray4, @oSocialStud10AvailableObj4Score, @oSocialStudObj104ObjectiveGrade, @oSocialStud10AvailableObj5, @oSocialStudObjScoresArray5, @oSocialStud10AvailableObj5Score, @oSocialStudObj105ObjectiveGrade, @oscience10AvailableObj1, @oscienceObjScoresArray1, @oscience10AvailableObj1Score, @oscienceObj101ObjectiveGrade, @oscience10AvailableObj2, @oscienceObjScoresArray2, @oscience10AvailableObj2Score, @oscienceObj102ObjectiveGrade, @oscience10AvailableObj3, @oscienceObjScoresArray3, @oscience10AvailableObj3Score, @oscienceObj103ObjectiveGrade, @oscience10AvailableObj4, @oscienceObjScoresArray4, @oscience10AvailableObj4Score, @oscienceObj104ObjectiveGrade, @oscience10AvailableObj5, @oscienceObjScoresArray5, @oscience10AvailableObj5Score, @oscienceObj105ObjectiveGrade, @oepfRaw101, @oepfRaw102, @oepfRaw103, @oepfRaw104, @ompfRaw101, @ompfRaw102, @ompfRaw103, @ompfRaw104, @ompfRaw105, @ompfRaw106, @ompfRaw107, @ompfRaw108, @ompfRaw109, @ompfRaw1010, @osspfRaw101, @osspfRaw102, @osspfRaw103, @osspfRaw104, @osspfRaw105, @ospfRaw101, @ospfRaw101, @ospfRaw102, @ospfRaw103, @ospfRaw104, @ospfRaw105)"
                        objCommand6.Parameters.Add("@oadmDate", SqlDbType.DateTime, 10).Value = madmDate
                        objCommand6.Parameters.Add("@ostudentId", SqlDbType.Int, 10).Value = studentId
                        objCommand6.Parameters.Add("@oteacherIdElaWriting", SqlDbType.Int, 8).Value = teacherIdElaWriting
                        objCommand6.Parameters.Add("@oteacherIdMath", SqlDbType.Int, 8).Value = teacherIdMath
                        objCommand6.Parameters.Add("@ograde", SqlDbType.Int, 2).Value = grade

                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj1", SqlDbType.Int, 4).Value = readingEla10AvailableObj1
                        objCommand6.Parameters.Add("@oreadingElaObjScoresArray1", SqlDbType.Int, 4).Value = readingElaObjScoresArray(1)
                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj1Score", SqlDbType.Int, 4).Value = ((readingElaObjScoresArray(1) / readingEla10AvailableObj1) * 100)
                        objCommand6.Parameters.Add("@oreadingElaObj101ObjectiveGrade", SqlDbType.VarChar, 4).Value = readingElaObj101ObjectiveGrade
                        objCommand6.Parameters.Add("@oepfRaw101", SqlDbType.Int, 2).Value = epfRaw101

                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj2", SqlDbType.Int, 4).Value = readingEla10AvailableObj2
                        objCommand6.Parameters.Add("@oreadingElaObjScoresArray2", SqlDbType.Int, 4).Value = readingElaObjScoresArray(2)
                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj2Score", SqlDbType.Int, 4).Value = ((readingElaObjScoresArray(2) / readingEla10AvailableObj2) * 100)
                        objCommand6.Parameters.Add("@oreadingElaObj102ObjectiveGrade", SqlDbType.VarChar, 4).Value = readingElaObj102ObjectiveGrade
                        objCommand6.Parameters.Add("@oepfRaw102", SqlDbType.Int, 2).Value = epfRaw102

                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj3", SqlDbType.Int, 4).Value = readingEla10AvailableObj3
                        objCommand6.Parameters.Add("@oreadingElaObjScoresArray3", SqlDbType.Int, 4).Value = readingElaObjScoresArray(3)
                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj3Score", SqlDbType.Int, 4).Value = ((readingElaObjScoresArray(3) / readingEla10AvailableObj3) * 100)
                        objCommand6.Parameters.Add("@oreadingElaObj103ObjectiveGrade", SqlDbType.VarChar, 4).Value = readingElaObj103ObjectiveGrade
                        objCommand6.Parameters.Add("@oepfRaw103", SqlDbType.Int, 2).Value = epfRaw103

                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj4", SqlDbType.Int, 4).Value = readingEla10AvailableObj4
                        objCommand6.Parameters.Add("@oreadingElaObjScoresArray4", SqlDbType.Int, 4).Value = readingElaObjScoresArray(4)
                        objCommand6.Parameters.Add("@oreadingEla10AvailableObj4Score", SqlDbType.Int, 4).Value = ((readingElaObjScoresArray(4) / readingEla10AvailableObj4) * 100)
                        objCommand6.Parameters.Add("@oreadingElaObj104ObjectiveGrade", SqlDbType.VarChar, 4).Value = readingElaObj104ObjectiveGrade
                        objCommand6.Parameters.Add("@oepfRaw104", SqlDbType.Int, 2).Value = epfRaw104




                        objCommand6.Parameters.Add("@math10AvailableObj1", SqlDbType.Int, 4).Value = math10AvailableObj1
                        objCommand6.Parameters.Add("@omathObjScoresArray", SqlDbType.Int, 4).Value = mathObjScoresArray(1)
                        objCommand6.Parameters.Add("@omath10AvailableObj1Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(1) / math10AvailableObj1) * 100)
                        objCommand6.Parameters.Add("@oMathObj101ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj101ObjectiveGrade
                        objCommand6.Parameters.Add("@oepfRaw101", SqlDbType.Int, 2).Value = epfRaw101

                        objCommand6.Parameters.Add("@math10AvailableObj2", SqlDbType.Int, 4).Value = math10AvailableObj2
                        objCommand6.Parameters.Add("@omathObjScoresArray2", SqlDbType.Int, 4).Value = mathObjScoresArray(2)
                        objCommand6.Parameters.Add("@omath10AvailableObj2Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(2) / math10AvailableObj2) * 100)
                        objCommand6.Parameters.Add("@oMathObj102ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj102ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw102", SqlDbType.Int, 2).Value = mpfRaw102

                        objCommand6.Parameters.Add("@math10AvailableObj3", SqlDbType.Int, 4).Value = math10AvailableObj3
                        objCommand6.Parameters.Add("@omathObjScoresArray3", SqlDbType.Int, 4).Value = mathObjScoresArray(3)
                        objCommand6.Parameters.Add("@omath10AvailableObj3Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(3) / math10AvailableObj3) * 100)
                        objCommand6.Parameters.Add("@oMathObj103ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj103ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw103", SqlDbType.Int, 2).Value = mpfRaw103

                        objCommand6.Parameters.Add("@math10AvailableObj4", SqlDbType.Int, 4).Value = math10AvailableObj4
                        objCommand6.Parameters.Add("@omathObjScoresArray4", SqlDbType.Int, 4).Value = mathObjScoresArray(4)
                        objCommand6.Parameters.Add("@omath10AvailableObj4Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(4) / math10AvailableObj4) * 100)
                        objCommand6.Parameters.Add("@oMathObj104ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj104ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw104", SqlDbType.Int, 2).Value = mpfRaw104

                        objCommand6.Parameters.Add("@math10AvailableObj5", SqlDbType.Int, 4).Value = math10AvailableObj5
                        objCommand6.Parameters.Add("@omathObjScoresArray5", SqlDbType.Int, 4).Value = mathObjScoresArray(5)
                        objCommand6.Parameters.Add("@omath10AvailableObj5Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(5) / math10AvailableObj5) * 100)
                        objCommand6.Parameters.Add("@oMathObj105ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj105ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw105", SqlDbType.Int, 2).Value = mpfRaw105

                        objCommand6.Parameters.Add("@math10AvailableObj6", SqlDbType.Int, 4).Value = math10AvailableObj6
                        objCommand6.Parameters.Add("@omathObjScoresArray6", SqlDbType.Int, 4).Value = mathObjScoresArray(6)
                        objCommand6.Parameters.Add("@omath10AvailableObj6Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(6) / math10AvailableObj6) * 100)
                        objCommand6.Parameters.Add("@oMathObj106ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj106ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw106", SqlDbType.Int, 2).Value = mpfRaw106

                        objCommand6.Parameters.Add("@math10AvailableObj7", SqlDbType.Int, 4).Value = math10AvailableObj7
                        objCommand6.Parameters.Add("@omathObjScoresArray7", SqlDbType.Int, 4).Value = mathObjScoresArray(7)
                        objCommand6.Parameters.Add("@omath10AvailableObj7Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(7) / math10AvailableObj7) * 100)
                        objCommand6.Parameters.Add("@oMathObj107ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj107ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw107", SqlDbType.Int, 2).Value = mpfRaw107

                        objCommand6.Parameters.Add("@math10AvailableObj8", SqlDbType.Int, 4).Value = math10AvailableObj8
                        objCommand6.Parameters.Add("@omathObjScoresArray8", SqlDbType.Int, 4).Value = mathObjScoresArray(8)
                        objCommand6.Parameters.Add("@omath10AvailableObj8Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(8) / math10AvailableObj8) * 100)
                        objCommand6.Parameters.Add("@oMathObj108ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj108ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw108", SqlDbType.Int, 2).Value = mpfRaw108

                        objCommand6.Parameters.Add("@math10AvailableObj9", SqlDbType.Int, 4).Value = math10AvailableObj9
                        objCommand6.Parameters.Add("@omathObjScoresArray9", SqlDbType.Int, 4).Value = mathObjScoresArray(9)
                        objCommand6.Parameters.Add("@omath10AvailableObj9Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(9) / math10AvailableObj9) * 100)
                        objCommand6.Parameters.Add("@oMathObj109ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj109ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw109", SqlDbType.Int, 2).Value = mpfRaw109

                        objCommand6.Parameters.Add("@math10AvailableObj10", SqlDbType.Int, 4).Value = math10AvailableObj10
                        objCommand6.Parameters.Add("@omathObjScoresArray10", SqlDbType.Int, 4).Value = mathObjScoresArray(10)
                        objCommand6.Parameters.Add("@omath10AvailableObj10Score", SqlDbType.Int, 4).Value = ((mathObjScoresArray(10) / math10AvailableObj10) * 100)
                        objCommand6.Parameters.Add("@oMathObj1010ObjectiveGrade", SqlDbType.VarChar, 4).Value = MathObj1010ObjectiveGrade
                        objCommand6.Parameters.Add("@ompfRaw1010", SqlDbType.Int, 2).Value = mpfRaw1010

                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj1", SqlDbType.Int, 4).Value = socialStud10AvailableObj1
                        objCommand6.Parameters.Add("@oSocialStudObjScoresArray1", SqlDbType.Int, 4).Value = socialStudObjScoresArray(1)
                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj1Score", SqlDbType.Int, 4).Value = ((socialStudObjScoresArray(1) / socialStud10AvailableObj1) * 100)
                        objCommand6.Parameters.Add("@oSocialStudObj101ObjectiveGrade", SqlDbType.VarChar, 4).Value = socialStudObj101ObjectiveGrade
                        objCommand6.Parameters.Add("@osspfRaw101", SqlDbType.Int, 2).Value = sspfRaw101

                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj2", SqlDbType.Int, 4).Value = socialStud10AvailableObj2
                        objCommand6.Parameters.Add("@oSocialStudObjScoresArray2", SqlDbType.Int, 4).Value = socialStudObjScoresArray(2)
                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj2Score", SqlDbType.Int, 4).Value = ((socialStudObjScoresArray(2) / socialStud10AvailableObj2) * 100)
                        objCommand6.Parameters.Add("@oSocialStudObj102ObjectiveGrade", SqlDbType.VarChar, 4).Value = socialStudObj102ObjectiveGrade
                        objCommand6.Parameters.Add("@osspfRaw102", SqlDbType.Int, 2).Value = sspfRaw102

                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj3", SqlDbType.Int, 4).Value = socialStud10AvailableObj3
                        objCommand6.Parameters.Add("@oSocialStudObjScoresArray3", SqlDbType.Int, 4).Value = socialStudObjScoresArray(3)
                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj3Score", SqlDbType.Int, 4).Value = ((socialStudObjScoresArray(3) / socialStud10AvailableObj3) * 100)
                        objCommand6.Parameters.Add("@oSocialStudObj103ObjectiveGrade", SqlDbType.VarChar, 4).Value = socialStudObj103ObjectiveGrade
                        objCommand6.Parameters.Add("@osspfRaw103", SqlDbType.Int, 2).Value = sspfRaw103

                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj4", SqlDbType.Int, 4).Value = readingEla10AvailableObj4
                        objCommand6.Parameters.Add("@oSocialStudObjScoresArray4", SqlDbType.Int, 4).Value = readingElaObjScoresArray(4)
                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj4Score", SqlDbType.Int, 4).Value = ((socialStudObjScoresArray(4) / socialStud10AvailableObj4) * 100)
                        objCommand6.Parameters.Add("@oSocialStudObj104ObjectiveGrade", SqlDbType.VarChar, 4).Value = socialStudObj104ObjectiveGrade
                        objCommand6.Parameters.Add("@osspfRaw104", SqlDbType.Int, 2).Value = sspfRaw104

                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj5", SqlDbType.Int, 4).Value = socialStud10AvailableObj5
                        objCommand6.Parameters.Add("@oSocialStudObjScoresArray5", SqlDbType.Int, 4).Value = socialStudObjScoresArray(5)
                        objCommand6.Parameters.Add("@oSocialStud10AvailableObj5Score", SqlDbType.Int, 4).Value = ((socialStudObjScoresArray(5) / socialStud10AvailableObj5) * 100)
                        objCommand6.Parameters.Add("@oSocialStudObj105ObjectiveGrade", SqlDbType.VarChar, 4).Value = socialStudObj105ObjectiveGrade
                        objCommand6.Parameters.Add("@osspfRaw105", SqlDbType.Int, 2).Value = sspfRaw105

                        objCommand6.Parameters.Add("@oscience10AvailableObj1", SqlDbType.Int, 4).Value = science10AvailableObj1
                        objCommand6.Parameters.Add("@oscienceObjScoresArray1", SqlDbType.Int, 4).Value = scienceObjScoresArray(1)
                        objCommand6.Parameters.Add("@oscience10AvailableObj1Score", SqlDbType.Int, 4).Value = ((scienceObjScoresArray(1) / science10AvailableObj1) * 100)
                        objCommand6.Parameters.Add("@oscienceObj101ObjectiveGrade", SqlDbType.VarChar, 4).Value = scienceObj101ObjectiveGrade
                        objCommand6.Parameters.Add("@ospfRaw101", SqlDbType.Int, 2).Value = spfRaw101

                        objCommand6.Parameters.Add("@oscience10AvailableObj2", SqlDbType.Int, 4).Value = science10AvailableObj2
                        objCommand6.Parameters.Add("@oscienceObjScoresArray2", SqlDbType.Int, 4).Value = scienceObjScoresArray(2)
                        objCommand6.Parameters.Add("@oscience10AvailableObj2Score", SqlDbType.Int, 4).Value = ((scienceObjScoresArray(2) / science10AvailableObj2) * 100)
                        objCommand6.Parameters.Add("@oscienceObj102ObjectiveGrade", SqlDbType.VarChar, 4).Value = scienceObj102ObjectiveGrade
                        objCommand6.Parameters.Add("@ospfRaw102", SqlDbType.Int, 2).Value = spfRaw102

                        objCommand6.Parameters.Add("@oscience10AvailableObj3", SqlDbType.Int, 4).Value = science10AvailableObj3
                        objCommand6.Parameters.Add("@oscienceObjScoresArray3", SqlDbType.Int, 4).Value = scienceObjScoresArray(3)
                        objCommand6.Parameters.Add("@oscience10AvailableObj3Score", SqlDbType.Int, 4).Value = ((scienceObjScoresArray(3) / science10AvailableObj3) * 100)
                        objCommand6.Parameters.Add("@oscienceObj103ObjectiveGrade", SqlDbType.VarChar, 4).Value = scienceObj103ObjectiveGrade
                        objCommand6.Parameters.Add("@ospfRaw103", SqlDbType.Int, 2).Value = spfRaw103

                        objCommand6.Parameters.Add("@oscience10AvailableObj4", SqlDbType.Int, 4).Value = science10AvailableObj4
                        objCommand6.Parameters.Add("@oscienceObjScoresArray4", SqlDbType.Int, 4).Value = scienceObjScoresArray(4)
                        objCommand6.Parameters.Add("@oscience10AvailableObj4Score", SqlDbType.Int, 4).Value = ((scienceObjScoresArray(4) / science10AvailableObj4) * 100)
                        objCommand6.Parameters.Add("@oscienceObj104ObjectiveGrade", SqlDbType.VarChar, 4).Value = scienceObj104ObjectiveGrade
                        objCommand6.Parameters.Add("@ospfRaw104", SqlDbType.Int, 2).Value = spfRaw104

                        objCommand6.Parameters.Add("@oscience10AvailableObj5", SqlDbType.Int, 4).Value = science10AvailableObj5
                        objCommand6.Parameters.Add("@oscienceObjScoresArray5", SqlDbType.Int, 4).Value = scienceObjScoresArray(5)
                        objCommand6.Parameters.Add("@oscience10AvailableObj5Score", SqlDbType.Int, 4).Value = ((scienceObjScoresArray(5) / science10AvailableObj5) * 100)
                        objCommand6.Parameters.Add("@oscienceObj105ObjectiveGrade", SqlDbType.VarChar, 4).Value = scienceObj105ObjectiveGrade
                        objCommand6.Parameters.Add("@ospfRaw105", SqlDbType.Int, 2).Value = spfRaw105

                        objConnection6.Open()
                        objCommand6.ExecuteNonQuery().ToString()
                        objConnection6.Close()

                    Catch ex As Exception
                        MsgBox(Err.Description)

                    End Try
0
kwh3856
Asked:
kwh3856
  • 3
  • 3
  • 2
  • +1
1 Solution
 
KGregCommented:
check the exception..  ex.Stacktrace..  it should give you a line number (the one at the top of the stack is the last one it hit)

Once you have the line number, look at that line.  My guess is that one of your Int parameters was initialized with a size that is too small.  If the line number it gives you points to a line where you're setting up an integer parameter, try upping the size.

Hope this helps!

KGreg
0
 
RonaldBiemansCommented:
Since we cannot run this code or check it, I would suggest that you put a breakpoint

on this line

objCommand6.Parameters.Add("@ostudentId", SqlDbType.Int, 10).Value = studentId

and walk through it (the error show that it is a problem with an integer variable)
and check every value you put into your parameter values

it should be between

-2,147,483,648 through 2,147,483,647.

0
 
RonaldBiemansCommented:
I also see that this couldn't work

 Catch ex As Exception
         MsgBox(Err.Description)
 End Try

the err.description is probably copied from vb6 code it should be ex.message

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kwh3856Author Commented:
I ran the program again with the ex.Stacktrace

The error message occurs on

objCommand6.ExecuteNonQuery().ToString()


Which means one of the variables I am writing to my table is wrong.  How do I get it to tell me which one of the variable has a problem.

Thanks
Kenny
0
 
KGregCommented:
change the exception handler to this:

 Catch ex As Exception
         MsgBox(ex.stacktrace)
 End Try

this will give you the line number.  Once you have that, tell us which line it is.  It is more than likely a line that adds an integer parameter which needs a different size.

KGreg
 
0
 
KGregCommented:
You'll have to do what RonaldBiemans said and add a break point and check the value of all integer parameters.

KGreg
0
 
RonaldBiemansCommented:
bye the way

I think it would be better using the cint around your calculations

 objCommand6.Parameters.Add("@oscience10AvailableObj3Score", SqlDbType.Int, 4).Value = CInt(((scienceObjScoresArray(3) / science10AvailableObj3) * 100))



0
 
wguerramCommented:
Can you post the structure of your table?

you can right click it and copy, then then paste it here.
0
 
kwh3856Author Commented:
Thank both of you for all your help.  Ronald Biemans....I am going to post the question again so I can give you 500 points also.  The answer was a problem with the wrong variable being used.  Both of you taught me some better diagnosing techniques so that is why I want to split the points.

Thanks
Kenny
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now