NexusDB Newsgroups

NexusDB Newsgroups (http://www.nexusdb.com/forums/index.php)
-   nexusdb.public.support.adoprovider (http://www.nexusdb.com/forums/forumdisplay.php?f=10)
-   -   NexusDB.ADOProvider version 4.0.0.321 (http://www.nexusdb.com/forums/showthread.php?t=20610)

ftessier 11th December 2018 12:04 AM

NexusDB.ADOProvider version 4.0.0.321
 
Hi,


When I try to use GetBytes, i receives the error message "An unhandled exception of type 'System.NotSupportedException' occurred in NexusDB.ADOProvider.dll".


The runtime version is V4.0.30319 et the ddl version is 4.0.0.321.

Can someone help me?

Regards,
Fran?ois Tessier

Eivind 11th December 2018 07:53 AM

Quote:

Originally Posted by ftessier (Post 111645)
Hi,


When I try to use GetBytes, i receives the error message "An unhandled exception of type 'System.NotSupportedException' occurred in NexusDB.ADOProvider.dll".


The runtime version is V4.0.30319 et the ddl version is 4.0.0.321.

Can someone help me?

Regards,
Fran?ois Tessier

Could you show the full line of code that is failing?

ftessier 11th December 2018 01:20 PM

Hello,

here the code:

clientele = (IDataRecord)_ClienteleEPXml;
FileStream fs; // Writes the BLOB to a file (*.bmp).
BinaryWriter bw; // Streams the BLOB to the FileStream object.
int bufferSize = 100; // Size of the BLOB buffer.
byte[] outbyte = new byte[bufferSize]; // The BLOB byte[] buffer to be filled by GetBytes.
long retval; // The bytes returned from GetBytes. .

long startIndex = 0; // The starting position in the BLOB output

fs = new FileStream(@"c:\fmp\Clienteletest.zip", FileMode.OpenOrCreate, FileAccess.Write);
bw = new BinaryWriter(fs);

// Reset the starting byte for the new BLOB.
startIndex = 0;


retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0, bufferSize);

// Continue reading and writing while there are bytes beyond the size of the buffer.
while (retval == bufferSize)
{
bw.Write(outbyte);
bw.Flush();

// Reposition the start index to the end of the last buffer and fill the buffer.
startIndex += bufferSize;
retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0, bufferSize);
}

Eivind 18th December 2018 09:05 AM

Quote:

Originally Posted by ftessier (Post 111650)
Hello,

here the code:

clientele = (IDataRecord)_ClienteleEPXml;
FileStream fs; // Writes the BLOB to a file (*.bmp).
BinaryWriter bw; // Streams the BLOB to the FileStream object.
int bufferSize = 100; // Size of the BLOB buffer.
byte[] outbyte = new byte[bufferSize]; // The BLOB byte[] buffer to be filled by GetBytes.
long retval; // The bytes returned from GetBytes. .

long startIndex = 0; // The starting position in the BLOB output

fs = new FileStream(@"c:\fmp\Clienteletest.zip", FileMode.OpenOrCreate, FileAccess.Write);
bw = new BinaryWriter(fs);

// Reset the starting byte for the new BLOB.
startIndex = 0;


retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0, bufferSize);

// Continue reading and writing while there are bytes beyond the size of the buffer.
while (retval == bufferSize)
{
bw.Write(outbyte);
bw.Flush();

// Reposition the start index to the end of the last buffer and fill the buffer.
startIndex += bufferSize;
retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0, bufferSize);
}

Thanks, we'll have a look.

Eivind Bakkestuen [NDD] 18th December 2018 11:00 AM

Re: NexusDB.ADOProvider version 4.0.0.321
 
Eivind wrote:

>
> ftessier;111650 Wrote:
> > Hello,
> >
> > here the code:
> >
> > clientele = (IDataRecord)_ClienteleEPXml;
> > FileStream fs; // Writes the BLOB to a
> > file (*.bmp).
> > BinaryWriter bw; // Streams the BLOB to the
> > FileStream object.
> > int bufferSize = 100; // Size of the BLOB
> > buffer.
> > byte[] outbyte = new byte[bufferSize]; // The BLOB byte[] buffer
> > to be filled by GetBytes.
> > long retval; // The bytes returned from
> > GetBytes. .
> >
> > long startIndex = 0; // The starting position
> > in the BLOB output
> >
> > fs = new FileStream(@"c:\fmp\Clienteletest.zip",
> > FileMode.OpenOrCreate, FileAccess.Write);
> > bw = new BinaryWriter(fs);
> >
> > // Reset the starting byte for the new BLOB.
> > startIndex = 0;
> >
> >
> > retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0,
> > bufferSize);
> >
> > // Continue reading and writing while there are bytes beyond the
> > size of the buffer.
> > while (retval == bufferSize)
> > {
> > bw.Write(outbyte);
> > bw.Flush();
> >
> > // Reposition the start index to the end of the last buffer and
> > fill the buffer.
> > startIndex += bufferSize;
> > retval = _ClienteleEPXml.GetBytes(1, startIndex, outbyte, 0,
> > bufferSize);
> > }

>
> Thanks, we'll have a look.


I haven't tried it, but simply calling GetValue(int i) on the
DbDataReader should return a byte array. Please let us know if that
works for you.

--
Eivind Bakkestuen [NDD]


All times are GMT +11. The time now is 12:01 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.