Jordi Maicas
6/5/2008 12:10:00 PM
Solved!!
It works (after that I'll rewrite it to detect inject-sql),
Boolean comprueba_loguin(String usuario,String password)
{
String prueba,cadena;
OleDbConnection myConn = new
OleDbConnection(TabStripApp.Properties.Settings.Default.onlydentConnectionString);
OleDbCommand myComm = new OleDbCommand("select usuario,password from
usuarios where usuario='"+usuario+"' and password='"+password+"'", myConn);
myConn.Open();
OleDbDataReader myReader = myComm.ExecuteReader();
if (myReader.HasRows)
{
myReader.Close();
return true;
}
else
{
myReader.Close();
return false;
}
}
"Hans Kesting" <news.hansdk@spamgourmet.com> escribi? en el mensaje
news:OLe9yDwxIHA.4500@TK2MSFTNGP04.phx.gbl...
> on 5-6-2008, JordiXip supposed :
>> I only receive an String resultado=
>> resultado "System.Data.OleDb.OleDbDataReader" string
>>
>> so, resultado="System.Data.OleDb.OleDbDataReader" , but it's not the
>> first record in my table.
>>
>
> ExecuteScalar will not return the first result from the *table*, it will
> return the value of the first column in the first record of the
> *resultset*, that is *after* the "select" has executed.
>
> Hans Kesting
>
>