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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sumonto Mehedi
NA
123
3.9k
Error: when Image data convert to pdf from DataGridView tbl.
Feb 26 2020 1:07 PM
Im trying to convert DataGridView data with image column which is filtered from my SQL Db into a PDF file in C# I wrote this code using iTextSharp!
but I got Error like this: "unable to cast object of type System.Drawing.bitmap to type system byte[]"
Can anyone help me out kindly?
Here is My Code:
Thanks !!!
foreach
(DataGridViewCell cell
in
row.Cells)
{
if
(row.Cells[0].Value!=
null
)
{
pdfTable.AddCell(row.Cells[0].Value.ToString());
}
if
(row.Cells[1].Value !=
null
)
{
byte
[] img = (
byte
[])row.Cells[1].Value;
pdfTable.AddCell(iTextSharp.text.Image.GetInstance(img));
}
}
Reply
Answers (
17
)
C# application not showing to other AD users in laptop
Create a extension with support all browers(google,mozilla)