private void BtnEjecutarPool_Click(object sender, System.EventArgs e)
{
valorconfig=System.Convert.ToInt32((System.Configuration.ConfigurationSettings.AppSettings[cantThread]));
cantThread=valorconfig;
//cantThread = System.Convert.ToInt32(TextBox1.Text.Trim());
/*ListBox1.Items.Clear();
this.ListBox2.Items.Clear();
this.ListBox3.Items.Clear();*/
for(int i=1;i<=cantThread;i++)
{
callBack = new WaitCallback(Conexiones_Oracle);
ThreadPool.QueueUserWorkItem(callBack," Conexion"+i);
}
}
int ticks = Environment.TickCount;
private void Conexiones_Oracle(object state)
{
String CnnOracle = "DSN=elite03;UID=ELITE;PWD=ELITE;DBQ=ELITE03;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;MTS=F;MDI=F;CSR=F;FWC=F;PFC=10;TLO=0;";
OdbcConnection CnnOra;
CnnOra = new OdbcConnection();
CnnOra.ConnectionString=(CnnOracle);
CnnOra.Open();
ListBox1.Items.Add("Procesando peticion" + state);
while(Environment.TickCount - ticks < 2000);
CnnOra.Close();
ListBox3.Items.Add("Peticion de conexion" + " " + state + " " + "Procesada");
ListBox2.Items.Add("Procesando Peticion " + " " + "el POOL esta en el hilo" +
state + " " + Thread.CurrentThread.IsThreadPoolThread + " " +
Thread.CurrentThread.GetHashCode());
Label1.Text=ListBox1.Items.Count.ToString();
Label2.Text=ListBox2.Items.Count.ToString();
Label3.Text=ListBox3.Items.Count.ToString();
}