Problem with public static byte Authenticate

06/10/2010 06:51 macht102#1
database.cs line 1498

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 && DSet.Tables["Account"].Rows.Count > 0) <-----1498
{
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) { General.WriteLine(Exc.ToString()); return 0; }
}

Not sure whats causing it, it just happens randomly and then no one can login.
i dont think its the login freeze, iv tried that already.

im using LOTF source 5017
06/10/2010 08:25 s.bat#2
You haven't told us what the problem is. In the future, format your code using the code tags.