K
kapatel
I was trying to insert 3Gb binary file to oracle 10g BLOB Field using
ADO.Net
The application uses Oracle Transaction .
Now I have tried to read the file using following code (C#)
string filePath = aFilePath ;
FileStream fls = new
FileStream(aFilePath,fileMode.open,FileAccess.Read);
byte[ ] blob = new byte[fls.length] ; // here I am Getting the error
fls.Read(blob,0,System.Convert.ToInt32(fls.Length));
The error was Arithmetic operation overflow .
After that tried to declare the array using actual no .
byte[] blob = new byte [1700000000] It is not giving the error (1.7
GB value)
byte[] blob = new byte [2000000000] Gives error of overflow (2 Gb
Value)
These nos are within the int32 limit .
The main purpose of the application is to insert 3 gb binary file in
the oracle 10gb
Database using the Ado.net application .(.Net Frame work 1.1 , C# ,
visual studio
2003 )
How I can read the 3 GB binary file using .net and store all the bytes
in array .
I do not want to update the record so I would like to assign the Array
of byte
as parameter Value as mention below.
OracleParameter pBlob = new
OracleParameter("I_MMS_DOC_BLOB_DATA",OracleType.Blob);
pBlob.Direction = ParameterDirection.Input ;
pBlob.Value = blob; // parameter of Array
fls.length is long but I am also not able to use the max value
of the int32 . Is there any limit on arraysize in .net 1.1 or there
is any other way to store all the bytes in the array .
ADO.Net
The application uses Oracle Transaction .
Now I have tried to read the file using following code (C#)
string filePath = aFilePath ;
FileStream fls = new
FileStream(aFilePath,fileMode.open,FileAccess.Read);
byte[ ] blob = new byte[fls.length] ; // here I am Getting the error
fls.Read(blob,0,System.Convert.ToInt32(fls.Length));
The error was Arithmetic operation overflow .
After that tried to declare the array using actual no .
byte[] blob = new byte [1700000000] It is not giving the error (1.7
GB value)
byte[] blob = new byte [2000000000] Gives error of overflow (2 Gb
Value)
These nos are within the int32 limit .
The main purpose of the application is to insert 3 gb binary file in
the oracle 10gb
Database using the Ado.net application .(.Net Frame work 1.1 , C# ,
visual studio
2003 )
How I can read the 3 GB binary file using .net and store all the bytes
in array .
I do not want to update the record so I would like to assign the Array
of byte
as parameter Value as mention below.
OracleParameter pBlob = new
OracleParameter("I_MMS_DOC_BLOB_DATA",OracleType.Blob);
pBlob.Direction = ParameterDirection.Input ;
pBlob.Value = blob; // parameter of Array
fls.length is long but I am also not able to use the max value
of the int32 . Is there any limit on arraysize in .net 1.1 or there
is any other way to store all the bytes in the array .