Solved

the value violates the maxlength of the column datagrid

Posted on 2009-04-14
7
254 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
  • 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now