Alright so this is what I have so far. I connect to a database with ODBC, I select the proper table and use it to fill a dataset, I send the dataset to a multidimensional array.
This is where I get stuck.
for (int i = 0; i < count; i++)
{
teams[i, 0] = dataset.Tables[0].Rows[i][0].ToString();
teams[i, 1] = dataset.Tables[0].Rows[i][1].ToString();
teams[i, 2] = dataset.Tables[0].Rows[i][2].ToString();
teamsint[i, 0] = Convert.ToInt32(teams[i, 0]);
teamsint[i, 1] = Convert.ToInt32(teams[i, 1]);
teamsint[i, 2] = Convert.ToInt32(teams[i, 2]);
txtLog.AppendText("Column 1: " + teams[i, 0] + " Column 2: " + teams[i, 1] + " Column 3: " + teams[i, 2] + "\r\n");
if (teamsint[i, 1] == 1)
{
Random random = new Random();
int seednumber = random.Next(0, 100000);
teamsint[i, 3] = seednumber;
}
}
The current code works perfectly but I would like to sort them based upon teamsint[i, 3].
After sorting them I want to set the highest 2 teams, the next 2 teams, the next 2 teams, and so on to the same number and store it in teamsint[i, 4]
Basically I am trying to create a random seeding system.