Click here to Skip to main content
15,910,121 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I've gone through many articles about this issue. But didn't get a proper answer or may be I'm not able to understand.

I've a table which stores receipt number, batch numbers and a copy of receipt as image in database

for ex: Referenceid : int
batchnumber : int
receiptcompressed : image

I'm trying display this data in datagridview.

VB
Dim sqlString As String
     'Dim cmd As SqlCommand
     Dim storeID As String
     Dim saleDate As String
     Dim ds As DataSet

     With DataGridView1
         storeID = .CurrentRow.Cells(1).Value
         saleDate = .CurrentRow.Cells(2).Value
     End With

     sqlString = "select batchnumber, [time],ReceiptCompressed from Journal where TransactionType=16 and StoreId ='" & storeID & "'" & _
                     "  and [Time] between '" & saleDate & " 00:00:00' and '" & saleDate & " 23:59:59'"




     ds = getDataset(connectionString, sqlString)

     DataGridView2.DataSource = ds.Tables(0)




Problem is an error is coming while loading the data.

"The following error occured in the datagridview

system.argumentexception.image.fromstream(system system, boolean useembeddedcolormanagement, boolean validateimagedata " etc.....


Can anyone tell me what is the simplest way to do this? As mentioned data stored in table I want to load into datagridview along with image.

Thanks
Venkat
Posted

I've tried but it's not working out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900