Try this:
mycmd2.CommandText = "update score set marks=@TOT where username=@UN";
mycmd2.Parameters.AddWithValue("@TOT", total);
mycmd2.Parameters.AddWithValue("@UN", Form2.Label3.Text);
mycmd.ExecuteNonQuery()
However, if Form2 is a class then you can't access labels like that, as they would have to be static, and controls don't work like that. If this code is part of the Form2 class, then:
mycmd2.Parameters.AddWithValue("@UN", Label3.Text);
If it is a different class, then you need to look at one of these:
Transferring information between two forms, Part 1: Parent to Child[
^]
Transferring information between two forms, Part 2: Child to Parent[
^]
Transferring information between two forms, Part 3: Child to Child[
^]
Exactly which one will depend on the relationship between the forms.