PHP Code:
public static Main.AuthWorker.AuthInfo Authenticate(string User, string Password)
{
Main.AuthWorker.AuthInfo Info = new NewestCOServer.Main.AuthWorker.AuthInfo();
Info.Account = User;
try
{
MySqlDataAdapter DataAdapter = null;
DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + User + "'", ReadConnection);//read
DataSet DSet = new DataSet();
DataAdapter.Fill(DSet, "Account");
if (DSet != null && DSet.Tables["Account"].Rows.Count > 0)
{
DataRow DR = DSet.Tables["Account"].Rows[0];
string RealAccount = (string)DR["AccountID"];
if (User == RealAccount)
{
string RealPassword = (string)DR["Password"];
if (RealPassword == "")
{
MySqlCommand cmd = new MySqlCommand("UPDATE `accounts` set `Password` = '" + Password + "' WHERE `AccountID` = '" + RealAccount + "'", WriteConnection);//white
cmd.ExecuteNonQuery();
Info.Status = (string)DR["Status"];
Info.Character = (string)DR["Character"];
if (Info.Character == "")
Info.LogonType = 2;
else
Info.LogonType = 1;
return Info;
}
if (RealPassword == Password)
{
Info.Status = (string)DR["Status"];
Info.Character = (string)DR["Character"];
if (Info.Character == "")
Info.LogonType = 2;
else
Info.LogonType = 1;
}
else
Info.LogonType = 255;
}
else
Info.LogonType = 255;
}
}
catch (Exception Exc) { Program.WriteLine(Exc); }
return Info;
}
i get error when server running say DataAdapter must be close and then i cant loging in to my server
plz i want code to close DataAdapter if it open every 1 second
and here pic