| 12
 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
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 
 | string source4 = "Server='"+IpServer+"';Port=5432;Password='"+Mdp+"';User Id='"+Login+"';Database='"+Base1+"';";
 
			try
			{
				Npgsql.NpgsqlConnection conn3 = new Npgsql.NpgsqlConnection(this.pgSqlConnection2.ConnectionString);
			{
				// Ouverture de la connexion
				conn3.Open();
 
				//
				//1ere REQUETE INSERT
				//
 
				int i=0;
				dl=DateTime.Now;
 
				while(i<Iteration)
				{
					//Insertion dans la table folio
					string sql1 = "INSERT INTO destination VALUES (1,'"+Adresse.Text+"')";
					Npgsql.NpgsqlCommand cmd1 = new Npgsql.NpgsqlCommand(sql1, conn3);
					int res1 = cmd1.ExecuteNonQuery();
					i++;
				}
 
				dl2=DateTime.Now;
 
				System.TimeSpan diff1=dl2.Subtract(dl);
 
 
				label13.Text=format(diff1);
 
				//
				//2ème REQUETE SELECT
				//
 
				dl=DateTime.Now;
 
				//Insertion dans la table folio
				string sql2 = "SELECT * FROM destination";
				Npgsql.NpgsqlCommand cmd2 = new Npgsql.NpgsqlCommand(sql2, conn3);
				int res2 = cmd2.ExecuteNonQuery();
 
				dl2=DateTime.Now;
 
				System.TimeSpan diff2=dl2.Subtract(dl);
 
 
				label14.Text=format(diff2);
 
				//
				//3ème REQUETE DELETE
				//
 
				dl=DateTime.Now;
 
				//Insertion dans la table folio
				string sql3 = "DELETE FROM destination";
				Npgsql.NpgsqlCommand cmd3 = new Npgsql.NpgsqlCommand(sql3, conn3);
				int res3 = cmd3.ExecuteNonQuery();
 
				dl2=DateTime.Now;
 
				System.TimeSpan diff3=dl2.Subtract(dl);
 
				label15.Text=format(diff3);		
 
				// Fermeture de la connexion
				conn3.Close();
 
			}//using
 
 
			}//try
			catch(Exception ex)
			{
				MessageBox.Show("Connexion à la base de données2 impossible : "+ex.Message.ToString(), "Erreur de connexion");
			}//catch | 
Partager