How to load a file into notepad without first loading into RAM?

I am using C # and I am having problems loading large files into a binary field using byte arrays.

Basically, if I upload a file that is too large, I am having memory problems.

Is there a way to load a file into a binary field without using large amounts of memory, i.e. Do not load the file into memory first?

If this helps, I use Advantage Database Server and this winforms application is not a web application.

Hi

+3
source share
4 answers

AdsExtendedReader.SetBytes . AdsSetBinary(), .

. AdsExtendedReader.SetBytes.

+5

Advantage (ACE) API AdsSetBinary blob . , , . #:

[DllImport("ace32.dll", CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Winapi )]
              public static extern uint AdsSetBinary( IntPtr hTable, String pucFldName, ushort usBinaryType, uint ulTotalLength, uint ulOffset, byte[] pucBuf, uint ulLen );   

API C:

http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.1/mergedProjects/ace/api2/adssetbinary.htm

API, . AdsExtendedReader.AdsHandle.

: Alex, , , , AdsSetBinary .NET-. , .:)

+2

, , , id , x .

0

"UPDATE.WRITE". . .WRITE : http://msdn.microsoft.com/en-us/library/ms177523.aspx.

Unfortunately, this is for SQL Server. I think the Advantage Database Server will be a little different here, but maybe this will send you in the right direction.

0
source

Source: https://habr.com/ru/post/1738888/


All Articles