A
Achim Kuehn
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?
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?