Solved

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

Posted on 2014-01-10
2
781 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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