Solved

Getting an error when loading a varbinary(MAX) column into a DataGridView

Posted on 2014-01-10
2
772 Views
Last Modified: 2014-01-10
I'm reading a Database Table and loading it directly into a DataGridView. I have a column in the DB Table defined as a VarBinary(MAX). It holds a PDF File.

The DGV will load successfully, however, my problem occurs when I scroll the dgv horizontally to view all the columns. Just before the column in question comes into view...it throws an error. See attachment for the error message.

Obviously this kind of field is huge and can't be loaded into a DGV. What is an alternative that will allow the record to be loaded into the DGV but even though the column has data in it?

Thanks,
Screenshot.jpg
0
Comment
Question by:BlakeMcKenna
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39771490
Can you not just modify the query on your database so that you do not return the VARBINARY column, or at least not bind that column to the grid?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39771506
It holds a PDF File.
The Image class doesn't support PDF. It supports bitmap-based images (e.g. BMP, PNG, TIFF).
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

21 Experts available now in Live!

Get 1:1 Help Now