I am currently working on a patching system in C# and I have came across a small complication. I am using MySQL to store an archive for my update list. The patching system then detects the version of program, and downloads every patch after that version. Though I just started learning how to use MySQL in C# so i'm not sure how to do, or call a lot of the functions needed. What I want to do is use foreach to call all values in the "version" column/row, then use a while loop to check against current version and new version until they are the same. I just cant seem to figure out how to use the two together and can't find any references.
using (SqlCon = new MySqlConnection(connString))
{
SqlCon.Open();
string command = "SELECT * FROM version ORDER BY version";
MySqlCommand GetLatestVersion = new MySqlCommand(command, SqlCon);
using (MySqlDataReader DR = GetLatestVersion.ExecuteReader())
{
while (DR.Read())
{
foreach(DataTable i in DR)
{
while(v1 < v2)
{
string LatestVersion = Convert.ToString(DR.GetValue(1));
string WebURL = Convert.ToString(DR.GetValue(2));
update.DownloadProgressChanged += new DownloadProgressChangedEventHandler(download);
update.DownloadFileCompleted += new AsyncCompletedEventHandler(extration);
update.DownloadFileAsync(new Uri(WebURL), tempFilePath + "patch" + Latest_Version + ".zip");
}
}
}
}
}
SqlCon.Close();
I would greatly appreciate any help.