Extraction BLOB Oracle en image JPEG
Bonjour,
je souhaite extraire une image stocké dans un BLOB d'une table Oracle et enregistré cette image. Pour cela, j'ai réalisé cette fonction:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
DataSet dsPhoto = new DataSet();
dsPhoto = OBM_T_CB_Photo_ORACLE.GET_DATASET(" NUM_DOSSIER = '" + ligne["NUDOS"].ToString() + "'");
if (dsPhoto.Tables[0].Rows.Count > 0)
{
string tmp = dsPhoto.Tables[0].Rows[0]["NOM_PHOTO"].ToString();
ligneCSV = ligneCSV + tmp;
ExtractionPhotoBaseToFileJPEG(dsPhoto);
}
....
public static void ExtractionPhotoBaseToFileJPEG(DataSet pImage)
{
try
{
string pathImage = "C:\\Images\\" + pImage.Tables[0].Rows[0]["NOM_PHOTO"].ToString();
Bitmap img = new Bitmap(new System.IO.MemoryStream((byte[])pImage.Tables[0].Rows[0]["FICHIER"]));
img.Save(pathImage);
}
catch (Exception ex)
{
throw new Exception(System.Reflection.MethodBase.GetCurrentMethod().Name + " " + ex.Message);
}
} |
cette fonction ne marche pas, elle me dit que le champs FICHIER n'appartien pas à la table t_cb_photo, alors que j'ai bien ce champs là dans ma table (en fait c'est mon champs BLOB que je sougaite extraire), voyez-vous le problème ? Y'a t'il une solution plus simple ?