?
Solved

the value violates the maxlength of the column datagrid

Posted on 2009-04-14
7
Medium Priority
?
278 Views
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
untitled.PNG
0
Comment
Question by:demoniumz
[X]
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
7 Comments
 
LVL 5

Expert Comment

by:brandonvmoore
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.
0
 
LVL 1

Author Comment

by:demoniumz
ID: 24135713
how to increase max lenght where to find if is option to increase it
0
 
LVL 5

Accepted Solution

by:
brandonvmoore earned 2000 total points
ID: 24135743
0
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!

 
LVL 5

Expert Comment

by:brandonvmoore
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 ;)
0
 
LVL 1

Author Comment

by:demoniumz
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

0
 
LVL 1

Author Comment

by:demoniumz
ID: 24135873
brandonvmoore: are  u here:p
0
 
LVL 5

Expert Comment

by:brandonvmoore
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.
0

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

649 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