Hi there,
string SQL = "INSERT INTO DOC_TEMPLATE_MST " +
"(DOCUMENTID,DOCUMENT_SOURCE) " + "VALUES(1,?)";
Cmd.Connection = db.GetOracleOleDBConnection();
Cmd.CommandType = CommandType.Text;
Cmd.CommandText = SQL ;
System.IO.FileStream fs = new System.IO.FileStream("D:\\test.txt",
System.IO.FileMode.Open,System.IO.FileAccess.Read);
//Create a byte array of file stream length
doc = new byte[fs.Length];
/Read block of bytes from stream into the byte array
fs.Read(doc,0,System.Convert.ToInt32(fs.Length));
//Close the File Stream
fs.Close();
Cmd.Parameters.Add( new
OleDbParameter("DOCUMENT_SOURCE",OleDbType.LongVarBinary));
Cmd.Parameters["DOCUMENT_SOURCE"].Direction =
ParameterDirection.Input;
Cmd.Parameters["DOCUMENT_SOURCE"].Value = doc;
Cmd.ExecuteNonQuery();
This GetOracleOleDBConnection function uses the following to get the
connection..
value="Provider=OraOLEDB.Oracle.1;User ID=test;Password=test;Data
Source=mainDB;OLEDB.NET=true;SPPrmsLOB=True;NDatatype=True;"
Please help...I am struck with it totally..!!