title: Cannot set Column 'name'. The value violates the MaxLength limit of this column
body: <p>I have a table with 5 columns.</p>
  
  <p>They are:</p>
  
  <p><strong>fItemID</strong> - Int IDENTITY Primary Key<br>
  <strong>fItemName</strong> - varchar(50)<br>
  <strong>fItemType</strong> - varchar(50)<br>
  <strong>fItemModel</strong> - varchar(50)<br>
  <strong>fItemWeight</strong> - int</p>
  
  <p>When I try to add data to the table, using a DataGridView, I have no problems as long as I keep the values under 10 characters, but when I try to add 11 or more, I get an error message on three of the columns.</p>
  
  <p>For <strong>fItemName</strong> and <strong>fItemType</strong>, I get:</p>
  
  <blockquote>
    <p><em>Cannot set Column 'name'. The value violates the MaxLength limit of this column.</em></p>
  </blockquote>
  
  <p>When I try to add more then 10 characters to <strong>fItemWeight</strong>, I get:</p>
  
  <blockquote>
    <p><em>System.FormatException: Value was either too large or too small for an Int32. ---> System.OverFlowException: Value was either too large or too small for an Int32.</em></p>
  </blockquote>
  
  <p>I have no idea why I am getting these errors, as adding info to <strong>fItemModel</strong> works perfectly.</p>
  
  <p>As usual, I am using VS2013 Ultimate and VB.Net.</p>
  
  <hr>
  
  <p>The following is all the code for the form:</p>
  
  <pre><code>Public Class frmBOMNonSteel
  
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          'TODO: This line of code loads data into the 'DbStarFliteSystemsDataset.tblItemsQuery' table. You can move, or remove it, as needed.
          Me.TblItemsQueryTableAdapter.Fill(Me.DbStarFliteSystemsDataset.tblItemsQuery)
          'TODO: This line of code loads data into the 'DbStarFliteSystemsDataset.tblItems' table. You can move, or remove it, as needed.
          Me.TblItemsTableAdapter.Fill(Me.DbStarFliteSystemsDataset.tblItems)
          'TODO: This line of code loads data into the 'DbStarFliteSystemsDataset.tblItems' table. You can move, or remove it, as needed.
          Me.TblItemsTableAdapter.Fill(Me.DbStarFliteSystemsDataset.tblItems)
          'TODO: This line of code loads data into the 'DbStarFliteSystemsDataset.tblItems' table. You can move, or remove it, as needed.
          Me.TblItemsTableAdapter.Fill(Me.DbStarFliteSystemsDataset.tblItems)
          'TODO: This line of code loads data into the 'DbStarFliteSystemsDataset.tblItems' table. You can move, or remove it, as needed.
          Me.TblItemsTableAdapter.Fill(Me.DbStarFliteSystemsDataset.tblItems)
          Me.txtJobNumber.Text = frmParent.ToolStripTextBox1.Text
  
          With FItemTypeComboBox
              .DataSource = DbStarFliteSystemsDataset.tblItemsQuery
              .ValueMember = "fItemType"
          End With
      End Sub
  
      Private Sub SteelToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SteelToolStripMenuItem.Click
  
          Me.Close()
          frmBOMSteel.MdiParent = frmParent
          frmBOMSteel.Show()
          frmBOMSteel.WindowState = FormWindowState.Maximized
      End Sub
  
      Private Sub NonSteelToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NonSteelToolStripMenuItem.Click
  
          Me.MdiParent = frmParent
          Me.Show()
      End Sub
  
      Private Sub WeightsRevisionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles WeightsRevisionsToolStripMenuItem.Click
  
          Me.Close()
          frmBOMWeightsRevisions.MdiParent = frmParent
          frmBOMWeightsRevisions.Show()
          frmBOMWeightsRevisions.WindowState = FormWindowState.Maximized
      End Sub
  
      Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
          frmModalNewItem.ShowDialog()
      End Sub
  
      Private Sub FItemTypeComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles FItemTypeComboBox.SelectedIndexChanged
  
          Me.FItemNameComboBox.Text = ""
  
          Dim selected As Object = Me.FItemTypeComboBox.SelectedItem
  
          If (TypeOf selected Is DataRowView) Then
  
              Dim row As DataRow = DirectCast(selected, DataRowView).Row
              Dim fItemType As String = CStr(row.Item("fItemType"))
              Dim view As New DataView(DbStarFliteSystemsDataset.tblItems)
  
              view.RowFilter = String.Format("[fItemType]='{0}'", fItemType)
              Me.FItemNameComboBox.DataSource = view.ToTable(True, "fItemName")
              Me.FItemNameComboBox.DisplayMember = "fItemName"
  
          End If
      End Sub
  
      Private Sub TblItemsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
          Me.Validate()
          Me.TblItemsBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.DbStarFliteSystemsDataset)
  
      End Sub
  
      Private Sub Button3_Click(sender As Object, e As EventArgs)
          Me.Validate()
          Me.TblItemsBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.DbStarFliteSystemsDataset)
  
      End Sub
  
      Private Sub TblItemsBindingNavigatorSaveItem_Click_1(sender As Object, e As EventArgs)
          Me.Validate()
          Me.TblItemsBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.DbStarFliteSystemsDataset)
  
      End Sub
  
      Private Sub TblItemsBindingNavigatorSaveItem_Click_2(sender As Object, e As EventArgs)
          Me.Validate()
          Me.TblItemsBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.DbStarFliteSystemsDataset)
  
      End Sub
  End Class
  </code></pre>
  
  <hr>
  
  <p>The following is the code for my Table:</p>
  
  <pre><code>CREATE TABLE [dbo].[tblItems] (
      [fItemID]     INT          IDENTITY (1, 1) NOT NULL,
      [fItemName]   VARCHAR (50) NULL,
      [fItemType]   VARCHAR (50) NULL,
      [fItemModel]  VARCHAR (50) NULL,
      [fItemWeight] INT          NULL,
      CONSTRAINT [PK_tblItems] PRIMARY KEY CLUSTERED ([fItemID] ASC)
  );
  </code></pre>