-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: aqua
Message 7 in Discussion

Hi try doing this code   public bool Check User(string UserName, string 
Password)
  {
   bool IsUserValid = false;
   //following connection object can be replaced with your common connection 
object
   SqlConnection myConn = new SqlConnection(DBConnectionString);
   string strSQL = "SELECT * FROM USER_MASTER WHERE USERNAME='"+UserName+"' AND 
PASSWORD='"+Password+"'";
   SqlCommand myCmd = new SqlCommand(strSQL);
   try
   {
    if (myConn.State.Equals(ConnectionState.Closed))
    {
     myConn.Open();
    }
    SqlDataAdapter _sqlDA = new SqlDataAdapter(myCmd,myConn);
    DataTable _dtUserInfo = new DataTable();
    _sqlDA.Fill(_dtUserInfo);
    if(_dtUserInfo == null)
    {
     if(_dtUserInfo.Rows.Count > 0)
     {
      IsUserValid = true;
     }
    }    }
   catch (Exception ex)
   {
     lblMessage2.Text = ex + "Error Connecting to the database";
   }
   
   return IsUserValid;
  }   cheers amit

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to