Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with inserting blob in oracle

495545May 3 2006
hi,

i have a problem writing a blob to oracle using ado.net. maybe someone can help.
here's my code:

OleDbConnection con = new OleDbConnection("Provider=msdaora;Data Source=orcl;User Id=******;Password=******;");
try
{
con.Open();
string save_blob = "INSERT INTO blobtable "
+ "(id,content) "
+ "VALUES "
+ "(1,:contentParam)";

OleDbParameter contentParameter = new OleDbParameter();
contentParameter.OleDbType = OleDbType.LongVarBinary;
contentParameter.ParameterName = "contentParam";
contentParameter.Value = this.content; // where content is an array of byte
OleDbCommand command = new OleDbCommand(save_blob, con);
command.Parameters.Add(contentParameter);
command.ExecuteNonQuery();
command.Dispose();
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write("DATABASE ERROR:" + ex);
}
finally
{
con.Close();
}


now everytime i try and run that code i get the following error:
A first chance exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
DATABASE ERROR:System.Data.OleDb.OleDbException: ORA-01008: not all variables bound
any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2006
Added on May 3 2006
0 comments
2,244 views