TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Handle the DataError Event
Venkatesan Jayakantham
May 03, 2012
25.7
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Handle the DataError event in datagridview
DataGridView Default Error Dialog
---------------------------
The following exception occurred in the DataGridView:
System.ArgumentException: Parameter is not valid.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at System.Drawing.ImageConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.Windows.Forms.Formatter.FormatObjectInternal(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue)
at System.Windows.Forms.Formatter.FormatObject(Object value, Type targetType, TypeConverter sourceConverter, TypeConverter targetConverter, String formatString, IFormatProvider formatInfo, Object formattedNullValue, Object dataSourceNullValue)
at System.Windows.Forms.DataGridViewCell.GetFormattedValue(Object value, Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
To replace this default dialog please handle the DataError event.
---------------------------
Solution:
I had my data in varbinary and trying to bind to the data grid.. Thats why problem occured. Modified the data into binary. This issue is resolved.
For more references:
http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/8e7dceaa-ce69-48dd-85e4-b6c6f5f03bd9
Cheers,
Venkatesan Prabu .J
Head, KaaShiv InfoTech.
http://www.kaashivinfotech.com/
Handle the DataError Event
Next Recommended Reading
Handling Verbose Error Message(Improper Error Handling) In Web.config