Read the Blob field of WMF and generate the wmf file.
/// <Summary>
/// Read the WMF field and generate a temporary WMF File
/// </Summary>
Private void ReadWMFBlobField ()
{
OracleConnection _ connection = new OracleConnection (m_connectionString );
Try
{
_ Connection. Open ();
OracleCommand _ selectCommand = _ connection. CreateCommand ();
OracleTransaction _ transaction = _ selectCommand. Connection. BeginTransaction ();
_ SelectCommand. Transaction = _ transaction;
String _ selectSQL = "Select WMF from hSUSEr. ZDT where ZDNO = '"
+ M_zoneNo + "'";
_ SelectCommand. CommandText = _ selectSQL;
OracleDataReader _ dataReader = _ selectCommand. ExecuteReader ();
If (_ dataReader. Read () = true)
{
Required lelob _ required lelob = _ dataReader. get1_lelob (0 );
Long _ byteCount = _ effeclelob. Length;
_ DataReader. Close ();
If (File. Exists (m_wmfFileName) = true)
{
File. Delete (m_wmfFileName );
}
FileStream _ fileStream = File. Open (m_wmfFileName, FileMode. OpenOrCreate );
Int _length = 30485760;
Byte [] _ buffer = new byte [_ length];
Int I = _ effeclelob. Read (_ buffer, 0, _ length );
While (I> 0)
{
_ FileStream. Write (_ buffer, 0, I );
I = _ effeclelob. Read (_ buffer, 0, _ length );
}
_ FileStream. Close ();
_ Canclelob. Close ();
_ SelectCommand. Parameters. Clear ();
_ Transaction. Commit ();
}
Else
{
MessageBoxEx. Show ("no matching records found! "," Prompt ", MessageBoxButtons. OK, MessageBoxIcon. Information );
}
}
Catch (Exception ex)
{
MessageBoxEx. Show (ex. Message, "Error", MessageBoxButtons. OK, MessageBoxIcon. Error );
}
}
Read the Blob field of DWG and generate the DWG file.
/// <Summary>
/// Read the DWG field and generate the DWG File
/// </Summary>
Private void ReadDWGBlobField ()
{
OracleConnection _ connection = new OracleConnection (m_connectionString );
Try
{
_ Connection. Open ();
OracleCommand _ selectCommand = _ connection. CreateCommand ();
OracleTransaction _ transaction = _ selectCommand. Connection. BeginTransaction ();
_ SelectCommand. Transaction = _ transaction;
String _ selectSQL = "Select DWG from hsuser. ZDT where ZDNO = '"
+ M_zoneNo + "'";
_ SelectCommand. CommandText = _ selectSQL;
OracleDataReader _ dataReader = _ selectCommand. ExecuteReader ();
If (_ dataReader. Read () = true)
{
Required lelob _ required lelob = _ dataReader. get1_lelob (0 );
Long _ byteCount = _ effeclelob. Length;
_ DataReader. Close ();
If (File. Exists (m_dwgFileName) = true)
{
File. Delete (m_dwgFileName );
}
FileStream _ fileStream = File. Open (m_dwgFileName, FileMode. OpenOrCreate );
Int _length = 30485760;
Byte [] _ buffer = new byte [_ length];
Int I;
While (I = _ effeclelob. Read (_ buffer, 0, _ length)> 0)
{
_ FileStream. Write (_ buffer, 0, I );
}
_ FileStream. Close ();
_ Canclelob. Clone ();
_ SelectCommand. Parameters. Clear ();
_ Transaction. Commit ();
}
Else
{
MessageBoxEx. Show ("no matching records found! "," Prompt ",
MessageBoxButtons. OK, MessageBoxIcon. Information );
}
}
Catch (Exception ex)
{
MessageBoxEx. Show (ex. Message, "warning", MessageBoxButtons. OK, MessageBoxIcon. Error );
}
}