dinosors_evolution
Messages postés14Date d'inscriptionvendredi 29 avril 2005StatutMembreDernière intervention12 juin 2007
-
12 juin 2007 à 03:11
SharpMao
Messages postés1024Date d'inscriptionmardi 4 février 2003StatutMembreDernière intervention 7 juin 2010
-
12 juin 2007 à 08:08
je ne sais plus quoi faire le code semble juste je les vus et revus alors si quelqu'un peut m'aider !!!
voila le code
<hr size="2" width="100%" /> public void ajout_dossier_image(string dossier,string matr)
{
if (Directory.Exists(dossier))
{ try
{
scanDirectory(dossier, "*.jpg", System.IO.SearchOption.TopDirectoryOnly);
String selectedImage = selectedImg;
if (imgList == null)
return;
foreach (String img in imgList) {ajout_image_seul(img, matr);}
}
catch (Exception exe) { MessageBox.Show("erreur du dossier de l'image");}
}
}
public void ajout_image_seul(string nom_img,string matr)
{
try
{
string date = "01/01/2005";//Convert.ToString(DateTime.Now)
string conStr = @"Provider=Microsoft.JET.OLEDB.4.0;" + @"data source=DermatoSoft_DB.mdb";
dataGridView1.DataSource = null;
ds = new DataSet();
conn = new OleDbConnection(conStr);
command = conn.CreateCommand();
conn.Open();
command.CommandText = "INSERT INTO Image (Numero_Patients,Nom_Image,Date_Image,"
+"Commentaire_Image) VALUES (" + matr + ",'" + nom_img + "','" + date + "','exemple commentaire')";
adapter = new OleDbDataAdapter(command);
adapter.Fill(ds);
conn.Close();
}
catch (Exception exe)
{
MessageBox.Show("erreur dans l'ajout de l'image");
}
}
<hr size="2" width="100%" />
merci