Make a try with this code

Code:
String strSQL = "Select Count(*) From Authenticate where UserId =+”’John’” + and Password =+”’Password’”;";
SqlCommand command = new SqlCommand(strSQL, Connection);

Connection.Open();
int a = command.ExecuteScaler();
if(a >0)
  blnRetVal = true;
return blnRetVal;
Its not adivasable to use the query instead try to use Stored procedure
Regards,
Venkatesan Prabu. J

Last edited by shabbir; 31Oct2007 at 19:52.. Reason: Code block