and replace it with:
Code:
public static byte Authenticate(string UserName, string Password) { try { MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection); DataSet DSet = new DataSet(); DataAdapter.Fill(DSet, "Account"); if (DSet == null) return 0; if (DSet.Tables.Count == 0) return 0; if (DSet.Tables["Account"].Rows.Count > 0) { DataRow DR = DSet.Tables["Account"].Rows[0]; string Pass = (string)DR["Password"]; if (Pass == Password || Pass == "") { if (Pass == "") { MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection); Command.ExecuteNonQuery(); } uint LogonCount = (uint)DR["LogonCount"]; LogonCount++; MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection); Comm.ExecuteNonQuery(); return Convert.ToByte((uint)DR["LogonType"]); } else return 0; } else return 0; } catch (Exception Exc) { Console.WriteLine(Exc.ToString()); return 0; } }