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 48 49 50 51 52 53 54 55
|
string connexionString;
string filename = @"D:\Equipe.bdd";
string sql;
int Y;
private void Form1_Load ( object sender, EventArgs e )
{
Y = 10;
id=1;
connexionString = "Data Source=" + filename + ";Version=3;";
SQLiteConnection connexion = new SQLiteConnection(connexionString);
sql = "select prenom,mail from techniciens where equipe = 1 order by prenom";
SQLiteCommand mycommand = new SQLiteCommand(sql, connexion);
connexion.Open();
SQLiteDataReader myreader = mycommand.ExecuteReader();
while (myreader.Read())
{
//textBox Prenom
TextBox TextBoxPrenom = new TextBox();
this.Controls.Add(TextBoxPrenom);
TextBoxPrenom.Visible = true;
TextBoxPrenom.AutoSize = true;
TextBoxPrenom.Location = new System.Drawing.Point(143, Y);
TextBoxPrenom.Text = (myreader.GetValue(0).ToString());
//textBox Mail
TextBox TextBoxMail = new TextBox();
this.Controls.Add(TextBoxMail);
TextBoxMail.Visible = true;
TextBoxMail.AutoSize = true;
TextBoxMail.Location = new System.Drawing.Point(260, Y);
TextBoxMail.Text = (myreader.GetValue(1).ToString());
Y = Y + 25;
}
myreader.Close();
connexion.Close();
} |
Partager