Hi. on my form, the field are entered depending on availability. some fields are mandatory while others are optional. The mandatory fields are inserted into one table called Receipt while the optional ones are saved in the other table called receiptLine. When all the fields are filled in, then the two tables are updated. Otherwise when only the necessary fields are filled, the first table is not filled. instead an error is raised which is "String or binary data would be truncated. The statement has been terminated."

Look at the form below. The second panel is the one that is optional,
How should I solve it?

Thank you

Hi. on my form, the field are entered depending on availability. some fields are mandatory while others are optional. The mandatory fields are inserted into one table called Receipt while the optional ones are saved in the other table called receiptLine. When all the fields are filled in, then the two tables are updated. Otherwise when only the necessary fields are filled, the first table is not filled. instead an error is raised which is "String or binary data would be truncated. The statement has been terminated."

Look at the form below. The second panel is the one that is optional,
How should I solve it?

Thank you

Try to check your fields table structure....Need to enlarge the columns width

hai,
is the receipt field is of nvarchar type. Increase the datatype size and try. (for testing you can provide nvarchar(max) and then adjust the size needed for your application).

Thanks,
Shenu

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.