Results 1 to 2 of 2

Thread: "String or binary data would be truncated" error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    "String or binary data would be truncated" error

    "String or binary data would be truncated.
    The statement has been terminated."


    ....... I'm glad it's telling my it would be truncated if I procede ... but, um... why in the world does it throw that error... I set the length of the columns in the table to 500 characters

    It throws it on the line of code that updates my table. ( I showed my add row too... I think it may be having issues with the new row)
    "My.Forms.Data.Reflex_DatabaseDataSet.Test_table.Rows.Add(newRow)
    My.Forms.Data.Test_tableTableAdapter.Update(My.Forms.Data.Reflex_DatabaseDataSet)"


    my entire setup looks like this:
    Code:
    newRow = My.Forms.Data.Reflex_DatabaseDataSet.Test_table.NewTest_tableRow
    
            If My.Forms.Info.TextBox1.Text = "Name (Optional)" Then
            Else
                newRow.Name = My.Forms.Info.TextBox1.Text
            End If
    
            If My.Forms.Info.RadioButton1.Checked = True Then
                newRow.Gender = "Male"
            ElseIf My.Forms.Info.RadioButton1.Checked = True Then
                newRow.Gender = "Female"
            End If
    
            newRow.Grade = My.Forms.Info.ComboBox1.Text
            newRow.Age = My.Forms.Info.ComboBox2.Text
            newRow.Time = DateTime.Now
            newRow._Date = Date.Today
            newRow._1_1 = pausetimearray(0)
            newRow._1_2 = timerecordarray(0)
            newRow._2_1 = pausetimearray(1)
            newRow._2_2 = timerecordarray(1)
            newRow._3_1 = pausetimearray(2)
            newRow._3_2 = timerecordarray(2)
            newRow._4_1 = pausetimearray(3)
            newRow._4_2 = timerecordarray(3)
            newRow._5_1 = pausetimearray(4)
            newRow._5_2 = timerecordarray(4)
            newRow._6_1 = pausetimearray(5)
            newRow._6_2 = timerecordarray(5)
            newRow._7_1 = pausetimearray(6)
            newRow._7_2 = timerecordarray(6)
            newRow._8_1 = pausetimearray(7)
            newRow._8_2 = timerecordarray(7)
            newRow._9_1 = pausetimearray(8)
            newRow._9_2 = timerecordarray(8)
            newRow._10_1 = pausetimearray(9)
            newRow._10_2 = timerecordarray(9)
            newRow._11_1 = pausetimearray(10)
            newRow._11_2 = timerecordarray(10)
            newRow._12_1 = pausetimearray(11)
            newRow._12_2 = timerecordarray(11)
            newRow._13_1 = pausetimearray(12)
            newRow._13_2 = timerecordarray(12)
            newRow._14_1 = pausetimearray(13)
            newRow._14_2 = timerecordarray(13)
            newRow._15_1 = pausetimearray(14)
            newRow._15_2 = timerecordarray(14)
            newRow._16_1 = pausetimearray(15)
            newRow._16_2 = timerecordarray(15)
            newRow._17_1 = pausetimearray(16)
            newRow._17_2 = timerecordarray(16)
            newRow._18_1 = pausetimearray(17)
            newRow._18_2 = timerecordarray(17)
            newRow._19_1 = pausetimearray(18)
            newRow._19_2 = timerecordarray(18)
            newRow._20_1 = pausetimearray(19)
            newRow._20_2 = timerecordarray(19)
    
            My.Forms.Data.Reflex_DatabaseDataSet.Test_table.Rows.Add(newRow)
            My.Forms.Data.Test_tableTableAdapter.Update(My.Forms.Data.Reflex_DatabaseDataSet)
    PS: I'm going to cut down the giant array thing (there are 40 there) and make a small loop.

    PSS: The arrays are both integer values... is that the problem? There is also a date/time and some text ones. I'm starting to think that I need to cstr() the integers
    Last edited by rbxslvr; May 1st, 2007 at 05:53 PM.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    Re: "String or binary data would be truncated" error

    I'm thinking of using Text files instead of the tables to store the data....

    I have 44 columns

    Where would the appropriate place be for me to ask a VB-Office question? I want to know if you can deal with file IO in Office.... (I want all of my data transfered to excel...).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width