troubleshooting Question

executenonquery() error.

Avatar of isaackhazi
isaackhazi asked on
.NET ProgrammingVisual Basic.NET
3 Comments1 Solution304 ViewsLast Modified:
I get the following error at the end of the command text:
"String or binary data would be truncated. The statement has been terminated."

Is there a way to simplify this query text. because there is no actual way to find the section where the error is occuring.
command.CommandText = "INSERT into tblSE_warranty_data(war_salespers_id, war_dealer_id, war_shop_id, war_card_id, " & _
         "war_trans_date, war_month, war_model_id, war_imei, war_firstname, war_lastname, war_address, " & _
         "war_email, war_sex, war_dob, war_news, war_news_method, war_info1, war_info2, war_info3, " & _
         "war_info4, war_info5, war_info6, war_info7, war_info8) " & _
         "VALUES(" & salesman.SelectedValue & ", " & dealer.SelectedValue & ", " & shop.SelectedValue & ", " & _
         "'" & warranty.Text & "','" & tdate.Value & "', '" & month.SelectedValue & "', '" & model.SelectedValue & "', " & _
         "'" & imei.Text & "', '" & fname.Text & "', '" & lname.Text & "', '" & address & "', '" & email.Text & "', " & _
         "'" & sex.ValueMember & "', '" & dob.Value & "', '" & no & "', '" & yes.Text & "', " & _
         "'" & tech & "', '" & ent & "', '" & cars & "', '" & home & "', '" & food & "', '" & business & "', '" & sport & "', " & _
         "'" & other & "') "
 
        command.ExecuteNonQuery()
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 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 3 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