title: Insert and read blob "pdf files" in oracle database with C#
body: <p>I want to insert and read pdf blop to oracle with c#.I tried to do something below.I need insert oracle blop pdf file with C#.I am using this code</p>
  
  <pre><code>var fs = new FileStream(txtFileName.Text, FileMode.Open, FileAccess.Read);
  var blobByte = new byte[fs.Length];
  fs.Read(blobByte, 0, Convert.ToInt32(fs.Length));
  fs.Close();
  id=nextİd("tablename")//take ID_SEQ.NEXTVAL
  var con = new racleConnection(System.Configuration.ConfigurationSettings.AppSettings["Orclsys"]);
  var cmd = new OracleCommand();
  con.Open();
  cmd.Connection = con;
  cmd.CommandText = "INSERT INTO tablename values(:id,:blopfile )";
  OracleTransaction sqlTrans = con.BeginTransaction();
  cmd.Transaction = sqlTrans;
  try
  {
      cmd.Parameters.Clear();
      cmd.Parameters.AddWithValue(":id", Id);
      var blobParameter = new OracleParameter();
      blobParameter.OracleType = OracleType.Blob;
      blobParameter.ParameterName = ":blopfile ";
      blobParameter.Value = blobByte;
      cmd.Parameters.Add(blobParameter);
      cmd.ExecuteNonQuery();
      Result = true;
      sqlTrans.Commit();
  }
  catch(Exception ex)
  {
  }
  finally
  {
      con.Close();
      con.Dispose();
      sqlTrans.Dispose();
      cmd.Dispose();
  }
  </code></pre>
  
  <p>so I want read this file from db and i am starting code but I can not continue.
  How can I continue after.could you help me.!!</p>
  
  <pre><code> try
   {
      orcl.Connect(DbUser.System);
      orcl.CommandText = "SELECT blopfile FROM tablename WHERE id= :id";
      orcl.ClearParameters();
      orcl.AddParameter(":id", id);
      orcl.ExecuteDataReader();               
      var lob = orcl.DataReader.GetOracleLob(0);
      var pdffile= new Bitmap(lob);
      //
      //how can I continue code here....
      //               
  }
  catch(Exception ex)
  {
  }
  </code></pre>