the value violates the maxlength of the column datagrid

Posted on 2009-04-14
Medium Priority
Last Modified: 2013-12-20
i have the provlem  when i save something in the coumn category name( like Drinks and tobaacos category)to not save and give this error see the photo for more information pls.Also in column photo they take the photo from the  the form of products i dont like to copy it from the products categories but have two diferent one for the categorie and one for the product
Question by:demoniumz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Expert Comment

ID: 24135626
Umm... could you rephrase that into a question of the coherent persuasion?

Are you wanting it to save longer values?  Increase the maxlength
Are you wanting to provide your own error message?  Handle the DataError Event

If this doesn't answer your question (I'm guessing it doesn't as the above is pretty obvious) then please let me know exactly what your question is.  Or if you just need help with 'how' to accomplish one of these let me know where you're getting stuck.

Author Comment

ID: 24135713
how to increase max lenght where to find if is option to increase it

Accepted Solution

brandonvmoore earned 2000 total points
ID: 24135743
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 24135748
I found that article by googling "datagrid maxlength".  You should be ashamed that you didn't find that on your own, just FYI ;)

Author Comment

ID: 24135793
problem 1 resolved

Dim dt As New DataTable
        dt.Columns.Add(New DataColumn("Categoryid", Type.GetType("System.String")))
        dt.Columns.Add(New DataColumn("categoryname", Type.GetType("System.String")))
        dt.Columns.Add(New DataColumn("description", Type.GetType("System.String")))

        'setting the max length of datacolumn "Code"
        dt.Columns("categoryname").MaxLength = 20

        'bind this datatable to datagrid
        CategoriesDataGridView.DataSource = CType(dt, DataTable)

Now what  about the picture i have a form  called products  diferent table categories diferent table why take the photo from the table  products and not from  from the table categories

i am using vb 2005 linked from ms access 2003


Author Comment

ID: 24135873
brandonvmoore: are  u here:p

Expert Comment

ID: 24135932
First of all, there are 2 f's in different.
Secondly, slow down.  I think your brain is going a little faster than your hands are typing.

As far as I can tell your question is "Why take the photo from the table products and not from the table categories?"  Now if you went up to some random programmer and asked him that question do you really expect that he would have a clue as to what you're talking about?

Just FYI, I probably won't get to posting again until after 5pm central time.

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question