public void SavePhoto(string data_id,byte[] p_Blob,string imgType)
{
OracleConnection cn=new OracleConnection("User id=ADMIN;Data Source=SGDC_ORA;password=123"); //oracle数据库
cn.Open();
try
{
OracleDataAdapter photoAdapter;  //da
DataSet photoDataSet;            //dataset
DataTable photoTable;            //table
DataRow photoRow;                //datarowphotoAdapter = new OracleDataAdapter(
"SELECT imgtitle,imgdata  FROM image WHERE imgtitle = '" + data_id+"'",cn);
photoDataSet= new DataSet("image");
photoAdapter.UpdateCommand = new OracleCommand
("UPDATE image SET imgdata = :vPHOTO WHERE imgtitle = :vID",cn);
photoAdapter.UpdateCommand.Parameters.Add(":vPHOTO",
OracleType.Blob, p_Blob.Length,"imgdata");
photoAdapter.UpdateCommand.Parameters.Add(":vID",
OracleType.VarChar,50,"imgtitle");photoAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;// Configures the schema to match with Data Source
photoAdapter.FillSchema(photoDataSet, SchemaType.Source,"image");// Fills the DataSet with 'drivers' table data
photoAdapter.Fill(photoDataSet,"image");// Get the current driver ID row for updation
photoTable = photoDataSet.Tables["image"];
photoRow = photoTable.Rows.Find(data_id);// Start the edit operation on the current row in
// the 'drivvers' table within the dataset.
photoRow.BeginEdit();
// Assign the value of the Photo if not empty
if (p_Blob.Length != 0)
{
photoRow["imgdata"] = p_Blob;
}
// End the editing current row operation
photoRow.EndEdit();// Update the database table 'drivers'
photoAdapter.Update(photoDataSet,"image");}
catch(Exception e)
{
throw e;
}
}