Solved

the value violates the maxlength of the column datagrid

Posted on 2009-04-14
7
265 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
Technology Partners: 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

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.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

688 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