bonjour a tous,  
 
je viens vers vous pour un petit souci qui a mon avis est simple mais que je n'arrive pas a comprendre  
 
Au passage de suis débutant en c# (en fait je bidouille plus qu'autre chose 
)  
 
voila le topo:  
 
1 je fais une requête sql suite a ça je crée des ligne a la volé avec 1 ligne par résultat sql avec a la fin de la ligne un bouton modifier  
 
voici le code (surement pas le meilleur d'ailleurs toute remarque sera intéressante 
  
 
Code :
 - private void affichage_list_article()
 -         {
 -             using (SqlCeConnection myConnection = new SqlCeConnection(@"Data Source=d:\utilisateurs\angelz\documents\visual studio 2012\Projects\BigRedOne-Gestion\BigRedOne-Gestion\data.sdf;Password=pass;" ))
 -             using (SqlCeCommand myCmd = myConnection.CreateCommand())
 -             {
 -                 myCmd.CommandType = CommandType.Text;
 -                 myCmd.CommandText = "SELECT * FROM gestion_stock ORDER BY id";
 -                 myConnection.Open();
 -                 SqlCeDataReader rdr = myCmd.ExecuteReader();
 -                 int pos_vertical = 65;
 -                 while (rdr.Read())
 -                 {
 -                     string nom = "";
 -                     string type = "";
 -                     string prix_achat_htva = "";
 -                     string prix_vente_htva = "";
 -                     string benefice_htva = "";
 -                     string prix_achat_ttc = "";
 -                     string prix_vente_ttc = "";
 -                     string benefice_ttc = "";
 -                     string fournisseur = "";
 -                     string tel_fournisseur = "";
 -                     string mail_fournisseur = "";
 -                     string quantite_stock = "";
 -                     string taux_tva = "";
 -                     Int64 id = rdr.GetInt64(0);
 -                     if (rdr.GetString(1) != null)
 -                     {
 -                         nom = rdr.GetString(1);
 -                     }
 -                     else
 -                     {
 -                         nom = "";
 -                     }
 -                     if (rdr.GetString(2) != null)
 -                     {
 -                         type = rdr.GetString(2);
 -                     }
 -                     else
 -                     {
 -                         type = "";
 -                     }
 -                     if (rdr.GetString(3) != null)
 -                     {
 -                         prix_achat_htva = rdr.GetString(3);
 -                     }
 -                     else
 -                     {
 -                         prix_achat_htva = "";
 -                     }
 -                     if (rdr.GetString(4) != null)
 -                     {
 -                         prix_vente_htva = rdr.GetString(4);
 -                     }
 -                     else
 -                     {
 -                         prix_vente_htva = "";
 -                     }
 -                     if (rdr.GetString(5) != null)
 -                     {
 -                         benefice_htva = rdr.GetString(5);
 -                     }
 -                     else
 -                     {
 -                         benefice_htva = "";
 -                     }
 -                     if (rdr.GetString(6) != null)
 -                     {
 -                         prix_achat_ttc = rdr.GetString(6);
 -                     }
 -                     else
 -                     {
 -                         prix_achat_ttc = "";
 -                     }
 -                     if (rdr.GetString(7) != null)
 -                     {
 -                         prix_vente_ttc = rdr.GetString(7);
 -                     }
 -                     else
 -                     {
 -                         prix_vente_ttc = "";
 -                     }
 -                     if (rdr.GetString(8) != null)
 -                     {
 -                         benefice_ttc = rdr.GetString(8);
 -                     }
 -                     else
 -                     {
 -                         benefice_ttc = "";
 -                     }
 -                     if (rdr.GetString(9) != null)
 -                     {
 -                         fournisseur = rdr.GetString(9);
 -                     }
 -                     else
 -                     {
 -                         fournisseur = "";
 -                     }
 -                     if (rdr.GetString(10) != null)
 -                     {
 -                         tel_fournisseur = rdr.GetString(10);
 -                     }
 -                     else
 -                     {
 -                         tel_fournisseur = "";
 -                     }
 -                     if (rdr.GetString(11) != null)
 -                     {
 -                         mail_fournisseur = rdr.GetString(11);
 -                     }
 -                     else
 -                     {
 -                         mail_fournisseur = "";
 -                     }
 -                     if (rdr.GetString(12) != null)
 -                     {
 -                         quantite_stock = rdr.GetString(12);
 -                     }
 -                     else
 -                     {
 -                         quantite_stock = "";
 -                     }
 -                     Int16 achat = rdr.GetInt16(13);
 -                     Int16 vente = rdr.GetInt16(14);
 -                    
 -                     if (rdr.GetString(15) != null)
 -                     {
 -                         taux_tva = rdr.GetString(15);
 -                     }
 -                     else
 -                     {
 -                         taux_tva = "";
 -                     }
 -                    
 -                     string id_string = Convert.ToString(id);
 -                     Label monlabelid = new Label();
 -                     monlabelid.Text = id_string;
 -                     monlabelid.Width = 30;
 -                     monlabelid.Location = new Point(16, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelid);
 -                     Label monlabelnom = new Label();
 -                     monlabelnom.Text = nom;
 -                     monlabelid.Width = 30;
 -                     monlabelnom.Location = new Point(70, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelnom);
 -                     Label monlabeltype = new Label();
 -                     monlabeltype.Text = type;
 -                     monlabeltype.Width = 90;
 -                     monlabeltype.Location = new Point(180, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabeltype);
 -                     Label monlabelachat = new Label();
 -                     monlabelachat.Text = prix_achat_ttc + " €";
 -                     monlabelachat.Width = 90;
 -                     monlabelachat.Location = new Point(320, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelachat);
 -                     Label monlabelvente = new Label();
 -                     monlabelvente.Text = prix_vente_ttc + " €";
 -                     monlabelvente.Width = 90;
 -                     monlabelvente.Location = new Point(420, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelvente);
 -                     Label monlabelbenef = new Label();
 -                     monlabelbenef.Text = benefice_ttc + " €";
 -                     monlabelbenef.Width = 90;
 -                     monlabelbenef.Location = new Point(520, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelbenef);
 -                     Label monlabeltva = new Label();
 -                     monlabeltva.Text = taux_tva + " %";
 -                     monlabeltva.Width = 50;
 -                     monlabeltva.Location = new Point(640, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabeltva);
 -                     Label monlabelfournisseur = new Label();
 -                     monlabelfournisseur.Text = fournisseur;
 -                     monlabelfournisseur.Width = 120;
 -                     monlabelfournisseur.Location = new Point(710, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelfournisseur);
 -                     if (achat == 1 && vente == 0)
 -                     {
 -                         Label monlabelachat_depot = new Label();
 -                         monlabelachat_depot.Text = "Achat";
 -                         monlabelachat_depot.Width = 60;
 -                         monlabelachat_depot.Location = new Point(880, pos_vertical);
 -                         affichage_stock.Controls.Add(monlabelachat_depot);
 -                     }
 -                     if (achat == 0 && vente == 1)
 -                     {
 -                         Label monlabelachat_depot = new Label();
 -                         monlabelachat_depot.Text = "Dépot";
 -                         monlabelachat_depot.Width = 60;
 -                         monlabelachat_depot.Location = new Point(880, pos_vertical);
 -                         affichage_stock.Controls.Add(monlabelachat_depot);
 -                     }
 -                     if (achat == 0 && vente == 0)
 -                     {
 -                         Label monlabelachat_depot = new Label();
 -                         monlabelachat_depot.Text = "?";
 -                         monlabelachat_depot.Width = 60;
 -                         monlabelachat_depot.Location = new Point(880, pos_vertical);
 -                         affichage_stock.Controls.Add(monlabelachat_depot);
 -                     }
 -                     Label monlabelquantite = new Label();
 -                     monlabelquantite.Text = quantite_stock;
 -                     monlabelquantite.Width = 30;
 -                     monlabelquantite.Location = new Point(990, pos_vertical);
 -                     affichage_stock.Controls.Add(monlabelquantite);
 -                     Button buttonModif = new Button();
 -                     buttonModif.Text = "Modifier";
 -                     buttonModif.Tag = id_string;
 -                     buttonModif.Click += buttonModif_Click;
 -                     buttonModif.Location = new Point(1050, pos_vertical);
 -                     affichage_stock.Controls.Add(buttonModif);
 -                    
 -                     pos_vertical = pos_vertical + 20;
 -                 }
 -                
 -                
 -                
 -                 myConnection.Close();
 -             }
 -         }
 
  | 
 
pour cette partie cela fonctionne  
 
2. lorsque que j’appuie sur le bouton modifier je voudrais ouvrir une autre form en lui passant la variable id pour pouvoir l'utiliser pour modifier/supprimer la ligne sql mais c'est la que je cale  
 
Code :
 - protected void buttonModif_Click(object sender, EventArgs e)
 -         {
 -            modif_article fc = new modif_article();
 -           fc.MdiParent = form_base.ActiveForm;
 -           fc.Show();
 -            
 -         }
 
  | 
 
et voici le code de la form modifier qui est appeler  
 
Code :
 - using System;
 - using System.Collections.Generic;
 - using System.ComponentModel;
 - using System.Data;
 - using System.Drawing;
 - using System.Linq;
 - using System.Text;
 - using System.Threading.Tasks;
 - using System.Windows.Forms;
 - namespace BigRedOne_Gestion
 - {
 -     public partial class modif_article : Form
 -     {
 -         public modif_article()
 -         {
 -             InitializeComponent();
 -         }
 -         private void modif_article_Load(object sender, EventArgs e)
 -         {
 -               MessageBox.Show(id);
 -         }
 -     }
 - }
 
  | 
 
voila déjà si je pouvez réussir a afficher l'id de la ligne sql dans la form modifier se serait déjà une grande victoire 
  
 
merci de votre aide