12/10/2008, 21:47
|
#1
|
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
|
[help] authenticate
Quote:
public static byte Authenticate(string UserName, string Password)
{
try
{
MySqlDataAdapter DataAdapter = new 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 == "")
{
if (DataBase.AllowQuerys)
DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection));
}
uint LogonCount = (uint)DR["LogonCount"];
LogonCount++;
if (DataBase.AllowQuerys)
DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection));
return Convert.ToByte((uint)DR["LogonType"]);
}
else
return 0;
}
else
return 0;
}
catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }
}
|
the **** console
Quote:
Accoun† £ogada Com Sucesso kayque IP >--> 189.69.66.198
System.InvalidOperationException: Connection must be valid and open
em MySql.Data.MySqlClient.MySqlCommand.CheckState()
em MySql.Data.MySqlClient.MySqlCommand.ExecuteReader( CommandBehavior behavior)
em MySql.Data.MySqlClient.MySqlCommand.System.Data.ID bCommand.ExecuteReader(CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
em UltimateCo.DataBase.Authenticate(String UserName, String Password) na C:\Documents and Settings\LOST\Desktop\FuckCo\UltimateCo\DataBase.c s:linha 1205
|
if anyone can help me :/
|
|
|