Solved

the value violates the maxlength of the column datagrid

Posted on 2009-04-14
7
260 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 500 total points
ID: 24135743
0
Independent Software Vendors: 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!

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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