Bonjour,

J'ai utilisé une listview afin de stoker des informations. Alors je voudrais enregistrer ces données dans une base de données.

Voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
 
		void InscrireClick(object sender, EventArgs e)
		{
 
		CLASS.ClsPreInscription pre=new MANBAT.CLASS.ClsPreInscription();
		Fonctions fonc=new Fonctions();
			  string ladate, annee,mois,jours,datefin,a,m,j;
	    annee= DTPickerDateDebut.Value.Year.ToString();
	    mois=DTPickerDateDebut.Value.Month.ToString();
	    jours=DTPickerDateDebut.Value.Day.ToString();
	    a=DTPickerDateFin.Value.Year.ToString();
	    m=DTPickerDateFin.Value.Month.ToString();
	   j=DTPickerDateFin.Value.Day.ToString();
 
	    ladate=annee+"-"+mois+"-"+jours;
	    datefin=a+"-"+m+"-"+j;
 
 
		int iNbRow = this.LstViewInscription.Items.Count;	 
 
	     for (int i = 0; i <iNbRow ; i++){
     	 		if (this.LstViewInscription.SelectedIndices.Count>0)
			{
            	int valeur=this.LstViewInscription.SelectedIndices[0];
 
 
			pre.NoModule=System.Convert.ToInt32(CBNoModule.Items[CBoxModule.SelectedIndex].ToString());
			//pre.NoClient=
			pre.Datedebut=ladate;
			pre.DateFin=datefin;
 
 
 
 
     	 		if(fonc.messageConfirmation("Voulez-vous réellement creer cet objet?","Etes vous sûr?"))
				{
				if(!pre.enregistrer())
					{
						fonc.messageErreur("Erreur durant la creation de cet objet", "Erreur");
						return;
					}
					fonc.messageInfo("l'objet a bien été enregistrer","Enregistrement reussi");
					this.Close();
 
			}
     	 		}
		}
Le problème c'est que je ne sais pas comment recupérer les données de la listview ?

Merci de m'aider.