RIAS
asked on
Memory out exception when using sqldatareader for extracting bytes
Hello,
I have an varbinary column which stores bytes for an image.
The query is throwing an exception Out of memory .
I am using a Stored Procedure to get the query result.
This is the code:
Any suggestions are appreciated as I have been struggling with this for quite a while.
Thanks
I have an varbinary column which stores bytes for an image.
The query is throwing an exception Out of memory .
I am using a Stored Procedure to get the query result.
This is the code:
Public Sub Populate(ByVal Command As SqlCommand)
'Accept command as string and fill the datatable with the result of sql query
Dim dt = New DataTable
Dim SQLdr As SqlDataReader
Try
SQLdr = Command.ExecuteReader(CommandBehavior.SequentialAccess)
dt.BeginLoadData()
dt.Load(SQLdr)
dt.EndLoadData()
Command.Connection.Close()
Application.DoEvents()
Command.Dispose()
Data_Table = dt
Catch MyException As SqlException
MessageBox.Show("Stored procedure Error: MySQL code: " &
MyException.Number & " " &
MyException.Message)
End Try
End Sub
Any suggestions are appreciated as I have been struggling with this for quite a while.
Thanks
Are you retrieving the whole table? How much data does the table contain?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.There is column of pictures saved as bytes , it has around 300 photos.
Thanks
Thanks
There is no good solution for that problem.