public void testLink()
{
int count = 0;
int intLength = 100;
MySqlConnection[] conn = new MySqlConnection[intLength];
MySqlCommand[] stmt = new MySqlCommand[intLength];
MySqlDataReader[] myReader = new MySqlDataReader[intLength];
try
{
string myConnectionString = "Server=192.160.10.130;UserId=root;Password=root;Database=camera";
for (count = 0; count < intLength; count++)
{
conn[count] = new MySqlConnection(myConnectionString);
string myInsertQuery = "Select * from t_pathinfo";
stmt[count] = new MySqlCommand(myInsertQuery);
stmt[count].Connection = conn[count];
conn[count].Open();
myReader[count] = stmt[count].ExecuteReader();
if (myReader[count].Read())
{
string strValue = myReader[count]["pathid"].ToString();
}
Console.WriteLine(count);
}
}
catch (Exception ex1)
{
throw new Exception(ex1.Message);
}
finally
{
try
{
count --;
for (; count >= 0; count--)
{
myReader[count].Close();
conn[count].Close();
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}