Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6704251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:16:02+00:00 2026-05-26T07:16:02+00:00

I have a WPF Visual Studio 2010 application with a window containing 2 buttons

  • 0

I have a WPF Visual Studio 2010 application with a window containing 2 buttons and a datagrid. I want to modify the values of some row from datagrid and when the “Set”-button is pushed the datagrid should be refreshed. The done changes should be saved only when a the Save button is pressed.

The refreshing works fine, but when I push the “save”-button I receive the following error message:

System.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.

My code at set button is:

myObjBase selected = this.dataGrid1.SelectedItem as nyObjBase;      
myObj ist = new myObj ();    
ist.field1= "";   
ist.field2 = 22;  
selected.myObj.Add(ist);    

and for the save button I have:

dataSource.SaveChanges();                   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:16:02+00:00Added an answer on May 26, 2026 at 7:16 am

    This error happens when the length of the data you’re trying to insert into a column is to long.

    You should check the max length property in your database and make sure that users can’t send a longer string then is allowed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a WPF application with Visual Studio 2010 Express. I have a
I have a WPF VB.NET project in Visual Studio 2008. For some reason, Visual
I have a Microsoft Access 2010 database(*). Now, using Visual Studio 2010, I want
Environment: Visual Studio Ultimate 2010 Windows XP WPF Desktop Application using .NET 4.0 We
I have a Visual Studio 2010 Entity Framework 4 WPF project and I'm not
I'm using Visual Studio 2010, c# WPF. I have created a MediaElement control during
C#, WPF, Windows 7, PC, Visaul Studio 2010 Application Easytask I have made an
C#, Visual Studio 2010, dot net 4, WPF, Microsoft Ribbon I have a WPF
I have a WPF application in VS 2008 with some web service references. For
I have several wpf pages with update/delete/add buttons. I want to display to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.