insert into two tables

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2009
Posts: 10
Reputation: marangajared is an unknown quantity at this point 
Solved Threads: 0
marangajared marangajared is offline Offline
Newbie Poster

insert into two tables

 
0
  #1
Oct 9th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 182
Reputation: Kusno is an unknown quantity at this point 
Solved Threads: 15
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster
 
0
  #2
Oct 12th, 2009
Originally Posted by marangajared View Post
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
NEVER NEVER NEVER GIVE UP
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 6
Reputation: shenulal is an unknown quantity at this point 
Solved Threads: 2
shenulal shenulal is offline Offline
Newbie Poster
 
0
  #3
Oct 13th, 2009
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
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 347 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC