小弟用ASP.NET保存图片到Oracle数据库
Oracle表是这么建的
create table phopo_gather(
ID varchar2(16) not null,
PlateNumber varchar2(15) not null,
PlateClass varchar(2) not null,
Photo1 Blob not null,
Photo2 Blob,
Photo3 Blob
);然后用ASP.NET往库中的Photo1字段插入图片,代码如下
HttpFileCollection myfilecollection;
myfilecollection=Request.Files;
HttpPostedFile file=myfilecollection[0];
byte[] by=new byte[file.ContentLength];
Stream stream=file.InputStream;
stream.Read(by,0,file.ContentLength);

OleDbConnection conn=new OleDbConnection("Provider=OraOLEDB.Oracle;Data Source=myoracle;User Id=system;Password=myoracle");
string sql="insert into phopo_gather(id,PlateNumber,PlateClass,Photo1)values(@id,@PlateNumber,@PlateClass,@Photo1)";
OleDbCommand comm=new OleDbCommand(sql,conn);
comm.Parameters.Add("@id",OleDbType.VarChar,16);
comm.Parameters["@id"].Value = "+@temp1+";
comm.Parameters.Add("@PlateNumber",OleDbType.VarChar,15);
comm.Parameters["@PlateNumber"].Value=System.DBNull.Value;
comm.Parameters.Add("@PlateClass",OleDbType.VarChar,2);
comm.Parameters["@PlateClass"].Value=System.DBNull.Value;
comm.Parameters.Add("@Photo1",OleDbType.VarBinary,file.ContentLength);
comm.Parameters["@Photo1"].Value=by;
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
return "";因为PlateNumber 、PlateClass这两个字段暂时没有值,所以插了两个空值。其中@temp1是参数存放的图片的名字形式是31977854在执行comm.ExecuteNonQuery();的时候出错ORA-00936: 缺少表达式 
应该是SQL语句插入数据的时候出现的错误,但是具体不知道哪里错了,希望高手给长长眼,谢谢了