<pre>private void timer2_Tick(object sender, EventArgs e) { //start time is another DateTime.now //timeSinceStart is an array of timeSpan //i believe that the for loop is for me to be able to create and store many values for //the timespan and update the listview items(see link below for the photo of the form) for (int w = 0; w < listView1.Items.Count; w++) { timeSinceStart[w] = DateTime.Now - startTime[w]; listView1.Items[w].SubItems[6].Text = (timeSinceStart[w].TotalSeconds.ToString()); if (f.ToString() == listView1.Items[w].SubItems[6].Text) { //you can ignore the mysql codes here //f.ToString() is default 60(its an integer) string constring = "server=localhost;database=dbhorizon;uid=root;password=1234"; string Query = "update tblUserIdd set User_Available = 'Available' where User_ID='" + listView1.Items[w].SubItems[0].Text + "' "; MySqlConnection conDatabase = new MySqlConnection(constring); MySqlCommand cmdDatabase = new MySqlCommand(Query, conDatabase); MySqlDataReader myReader; conDatabase.Open(); myReader = cmdDatabase.ExecuteReader(); dgvref(); //this is what matters MessageBox.Show("dedede"); } else { label3.Text = timeSinceStart[w].TotalSeconds.ToString(); } }
f
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)