473,467 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LoginControl VS 2005

4 New Member
Hello,

I have used Login Control for ASP.NEt with VS2005. I have followed the directions in the site
http://www.devx.com/asp/Article/29256
and converted the same for Oracle. It's working perfect in vb code behind. But the same I converted to C#
and it's showing erros like

1. OracleMembershipProvider.CreateUser(string, string, string, string, string, bool, object, ref System.Web.Security.MembershipCreateStatus)': no suitable method found to override
2. OracleMembershipProvider' does not implement inherited abstract member 'System.Web.Security.MembershipProvider.CreateUser (string, string, string, string, string, bool, object, out System.Web.Security.MembershipCreateStatus)'


There are 8 erros like this for GetALLUsers,FindUsersByEmail,FindUsersByName etc

Could any one help

Thanks Ceema


the following code


Expand|Select|Wrap|Line Numbers
  1. using System.Web.Security;
  2. using System.Data;
  3. using System.Data.OracleClient;
  4. using System.Configuration;
  5. using System.Web;
  6. using System;
  7. using System.Collections;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Web.UI.HtmlControls;
  12.  
  13. /// <summary>
  14. /// Summary description for AccessMembershipProvider
  15. /// </summary>
  16. public class OracleMembershipProvider : MembershipProvider
  17. {
  18.     private string connStr;
  19.     private OracleCommand comm = new OracleCommand();
  20.     private bool _requiresQuestionAndAnswer;
  21.     private int _minRequiredPasswordLength;
  22.  
  23.     public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
  24.     {
  25.         if (config("requiresQuestionAndAnswer") == "true")
  26.         {
  27.             _requiresQuestionAndAnswer = true;
  28.         }
  29.         connStr = config("connectionString");
  30.         base.Initialize(name, config);
  31.     }
  32.  
  33.     public override string ApplicationName
  34.     {
  35.         get
  36.         {
  37.         }
  38.         set
  39.         {
  40.         }
  41.     }
  42.  
  43.     public override bool ChangePassword(string username, string oldPassword, string newPassword)
  44.     {
  45.     }
  46.  
  47.     public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
  48.     {
  49.     }
  50.  
  51.     public override System.Web.Security.MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, ref System.Web.Security.MembershipCreateStatus status)
  52.     {
  53.         OracleConnection conn = new OracleConnection(connStr);
  54.         try
  55.         {
  56.             conn.Open();
  57.             string sql = "INSERT INTO XX_Test_Membership VALUES (" + "@username, @pwd, @email, " + " @passwordQuestion, @passwordAnswer )";
  58.             OracleCommand comm = new OracleCommand(sql, conn);
  59.             comm.Parameters.AddWithValue("@username", username);
  60.             comm.Parameters.AddWithValue("@pwd", password);
  61.             comm.Parameters.AddWithValue("@email", email);
  62.             comm.Parameters.AddWithValue("@passwordQuestion", passwordQuestion);
  63.             comm.Parameters.AddWithValue("@passwordAnswer", passwordAnswer);
  64.             int result = comm.ExecuteNonQuery();
  65.             conn.Close();
  66.             status = MembershipCreateStatus.Success;
  67.             MembershipUser user = new MembershipUser("AccessMembershipProvider", username, null, email, passwordQuestion, null, true, false, Now, null, null, null, null);
  68.             return user;
  69.         }
  70.         catch (Exception ex)
  71.         {
  72.             status = MembershipCreateStatus.UserRejected;
  73.             return null;
  74.         }
  75.     }
  76.  
  77.     public override bool DeleteUser(string username, bool deleteAllRelatedData)
  78.     {
  79.     }
  80.  
  81.     public override bool EnablePasswordReset
  82.     {
  83.         get
  84.         {
  85.         }
  86.     }
  87.  
  88.     public override bool EnablePasswordRetrieval
  89.     {
  90.         get
  91.         {
  92.         }
  93.     }
  94.  
  95.     public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, ref int totalRecords)
  96.     {
  97.         throw new Exception("The method or operation is not implemented.");
  98.  
  99.     }
  100.  
  101.     public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, ref int totalRecords)
  102.     {
  103.         throw new Exception("The method or operation is not implemented.");
  104.     }
  105.  
  106.     public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, ref int totalRecords)
  107.     {
  108.         throw new Exception("The method or operation is not implemented.");
  109.     }
  110.  
  111.     public override int GetNumberOfUsersOnline()
  112.     {
  113.     }
  114.  
  115.     public override string GetPassword(string username, string answer)
  116.     {
  117.     }
  118.  
  119.     public override System.Web.Security.MembershipUser GetUser(string username, bool userIsOnline)
  120.     {
  121.     }
  122.  
  123.     public override System.Web.Security.MembershipUser GetUser(object providerUserKey, bool userIsOnline)
  124.     {
  125.     }
  126.  
  127.     public override string GetUserNameByEmail(string email)
  128.     {
  129.     }
  130.  
  131.     public override int MaxInvalidPasswordAttempts
  132.     {
  133.         get
  134.         {
  135.         }
  136.     }
  137.  
  138.     public override int MinRequiredNonAlphanumericCharacters
  139.     {
  140.         get
  141.         {
  142.         }
  143.     }
  144.  
  145.     public override int MinRequiredPasswordLength
  146.     {
  147.         get
  148.         {
  149.         }
  150.     }
  151.  
  152.     public override int PasswordAttemptWindow
  153.     {
  154.         get
  155.         {
  156.         }
  157.     }
  158.  
  159.     public override System.Web.Security.MembershipPasswordFormat PasswordFormat
  160.     {
  161.         get
  162.         {
  163.         }
  164.     }
  165.  
  166.     public override string PasswordStrengthRegularExpression
  167.     {
  168.         get
  169.         {
  170.         }
  171.     }
  172.  
  173.     public override bool RequiresQuestionAndAnswer
  174.     {
  175.         get
  176.         {
  177.             if (_requiresQuestionAndAnswer == true)
  178.             {
  179.                 return true;
  180.             }
  181.             else
  182.             {
  183.                 return false;
  184.             }
  185.         }
  186.     }
  187.  
  188.     public override bool RequiresUniqueEmail
  189.     {
  190.         get
  191.         {
  192.         }
  193.     }
  194.  
  195.     public override string ResetPassword(string username, string answer)
  196.     {
  197.     }
  198.  
  199.     public override bool UnlockUser(string userName)
  200.     {
  201.     }
  202.  
  203.     public override void UpdateUser(System.Web.Security.MembershipUser user)
  204.     {
  205.     }
  206.  
  207.     public override bool ValidateUser(string username, string password)
  208.     {
  209.         OracleConnection conn = new OracleConnection(connStr);
  210.         try
  211.         {
  212.             conn.Open();
  213.             string sql = "Select * From XX_Test_Membership WHERE " + "UserName='" + username + "' AND PWD='" + password + "'";
  214.             OracleCommand comm = new OracleCommand(sql, conn);
  215.             OracleDataReader reader = comm.ExecuteReader;
  216.             if (reader.HasRows)
  217.             {
  218.                 return true;
  219.             }
  220.             else
  221.             {
  222.                 return false;
  223.             }
  224.             conn.Close();
  225.         }
  226.         catch (Exception ex)
  227.         {
  228.             Console.Write(ex.ToString);
  229.             return false;
  230.         }
  231.     }
  232. }
Mar 13 '07 #1
5 3854
ceema
4 New Member
Hello,

I have solved all those errors by changing the code as follows. But now I am getting the error like ( since the size of the post is restricted, I am avoiding some of the class file codes and posting as next reply)
Provider name cannot be null or empty.
Description: An unhandled exception occurred during the execution of the current web request....
Stack Trace:


[ArgumentException: Provider name cannot be null or empty.]
System.Web.Security.Membership.Initialize() +1068
System.Web.UI.WebControls.LoginUtil.GetProvider(St ring providerName) +33
System.Web.UI.WebControls.CreateUserWizard.get_Que stionAndAnswerRequired() +90
System.Web.UI.WebControls.CreateUserWizard.UpdateV alidators() +1134
System.Web.UI.WebControls.CreateUserWizard.CreateC hildControls() +32
System.Web.UI.Control.EnsureChildControls() +97
System.Web.UI.WebControls.Wizard.OnInit(EventArgs e) +100
System.Web.UI.Control.InitRecursive(Control namingContainer) +346
System.Web.UI.Control.InitRecursive(Control namingContainer) +197
System.Web.UI.Control.InitRecursive(Control namingContainer) +197
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1795

***************************************My Code*****************************


In web.config

Expand|Select|Wrap|Line Numbers
  1. <membership defaultProvider="OracleMembershipProvider">
  2. <providers>
  3. <add  type="OracleMembershipProvider" requiresQuestionAndAnswer="true" connectionString="Data Source=erpudev;User Id=web_t_user;Password=oracle123;Integrated Security=no;" name="OracleMembershipProvider"/>
  4. </providers>
  5. </membership>
  6.  
  7. in class file
  8.  
  9. using System.Web.Security;
  10. using System.Data;
  11. using System.Data.OracleClient;
  12. using System.Configuration;
  13. using System.Web;
  14. using System;
  15. using System.Collections;
  16. using System.Web.UI;
  17. using System.Web.UI.WebControls;
  18. using System.Web.UI.WebControls.WebParts;
  19. using System.Web.UI.HtmlControls;
  20.  
  21.  
  22. /// <summary>
  23. /// Summary description for AccessMembershipProvider
  24. /// </summary>
  25. public class OracleMembershipProvider : MembershipProvider
  26. {
  27.     private string connStr;
  28.     private OracleCommand comm = new OracleCommand();
  29.     private bool _requiresQuestionAndAnswer;
  30.     private int _minRequiredPasswordLength;
  31.  
  32.     public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
  33.     {
  34.         //if (config("requiresQuestionAndAnswer") == "true")
  35.         //{
  36.         //    _requiresQuestionAndAnswer = true;
  37.         //}
  38.         //connStr = config("connectionString");
  39.         //base.Initialize(name, config);
  40.     }
  41.  
  42.     public override string ApplicationName
  43.     {
  44.         get { throw new NotSupportedException(); }
  45.         set { throw new NotSupportedException(); }
  46.  
  47.     }
  48.  
  49.     public override bool ChangePassword(string username, string oldPassword, string newPassword)
  50.     {
  51.         throw new Exception("The method or operation is not implemented.");
  52.     }
  53.  
  54.     public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
  55.     {
  56.         throw new Exception("The method or operation is not implemented.");
  57.     }
  58.  
  59.  
  60.  
  61.     public override MembershipUser CreateUser(string username, string
  62.           password, string email, string passwordQuestion, string
  63.           passwordAnswer, bool isApproved, object providerUserKey,
  64.           out MembershipCreateStatus status)
  65.     {
  66.         OracleConnection cnn = null;
  67.         OracleCommand cmd = null;
  68.         MembershipUser newUser = null;
  69.         try
  70.         {
  71.             cnn = new OracleConnection();
  72.             cnn.ConnectionString = connStr;
  73.             cnn.Open();
  74.             string insertQry = "INSERT INTO XX_Test_Membership VALUES (" + "@username, @pwd, @email, " + " @passwordQuestion, @passwordAnswer )";
  75.             cmd = new OracleCommand(insertQry, cnn);
  76.             cmd.ExecuteNonQuery();
  77.  
  78.             // Right now I am giving default values for DateTime
  79.             // in Membership constructor.
  80.             newUser = new MembershipUser("OracleMembershipProvider", username, null, String.Empty, String.Empty, String.Empty, true, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);
  81.             status = MembershipCreateStatus.Success;
  82.         }
  83.         catch (Exception ex)
  84.         {
  85.             status = MembershipCreateStatus.ProviderError;
  86.             newUser = null;
  87.             throw ex;
  88.         }
  89.         finally
  90.         {
  91.             cmd.Dispose();
  92.             cnn.Close();
  93.         }
  94.         return newUser;
  95.     }
  96.  
  97.     /*public override System.Web.Security.MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, ref System.Web.Security.MembershipCreateStatus status)
  98.     //public void  CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, ref System.Web.Security.MembershipCreateStatus status)
  99.     {
  100.         OracleConnection conn = new OracleConnection(connStr);
  101.         try
  102.         {
  103.             conn.Open();
  104.             string sql = "INSERT INTO XX_Test_Membership VALUES (" + "@username, @pwd, @email, " + " @passwordQuestion, @passwordAnswer )";
  105.             OracleCommand comm = new OracleCommand(sql, conn);
  106.             comm.Parameters.AddWithValue("@username", username);
  107.             comm.Parameters.AddWithValue("@pwd", password);
  108.             comm.Parameters.AddWithValue("@email", email);
  109.             comm.Parameters.AddWithValue("@passwordQuestion", passwordQuestion);
  110.             comm.Parameters.AddWithValue("@passwordAnswer", passwordAnswer);
  111.             int result = comm.ExecuteNonQuery();
  112.             conn.Close();
  113.             status = MembershipCreateStatus.Success;
  114.             MembershipUser user = new MembershipUser("AccessMembershipProvider", username, null, email, passwordQuestion, null, true, false, Now, null, null, null, null);
  115.             return user;
  116.         }
  117.         catch (Exception ex)
  118.         {
  119.             status = MembershipCreateStatus.UserRejected;
  120.             return null;
  121.         }
  122.     }*/
  123.  
  124.     public override bool DeleteUser(string username, bool deleteAllRelatedData)
  125.     {
  126.         throw new Exception("The method or operation is not implemented.");
  127.     }
  128.  
  129.     public override bool EnablePasswordReset
  130.     {
  131.         get { return false; }
  132.  
  133.     }
  134.  
  135.     public override bool EnablePasswordRetrieval
  136.     {
  137.         get { return false; }
  138.  
  139.     }
Mar 13 '07 #2
ceema
4 New Member
Balance code

Expand|Select|Wrap|Line Numbers
  1.  public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
  2.     {
  3.         throw new Exception("The method or operation is not implemented.");
  4.     }
  5.     public override MembershipUserCollection FindUsersByEmail(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
  6.     {
  7.         throw new Exception("The method or operation is not implemented.");
  8.     }
  9.     public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
  10.     {
  11.         throw new Exception("The method or operation is not implemented.");
  12.     }
  13.    /* //public void FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, ref int totalRecords)
  14.     public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, ref int totalRecords)
  15.     {
  16.         throw new Exception("The method or operation is not implemented.");
  17.  
  18.     }*/
  19.  
  20.     /*public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, ref int totalRecords)
  21.     {
  22.         throw new Exception("The method or operation is not implemented.");
  23.     }*/
  24.  
  25.    /* public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, ref int totalRecords)
  26.     {
  27.         throw new Exception("The method or operation is not implemented.");
  28.     }*/
  29.  
  30.     public override int GetNumberOfUsersOnline()
  31.     {
  32.         throw new NotSupportedException();
  33.     }
  34.  
  35.     public override string GetPassword(string username, string answer)
  36.     {
  37.         throw new NotSupportedException();
  38.     }
  39.  
  40.     public override System.Web.Security.MembershipUser GetUser(string username, bool userIsOnline)
  41.     {
  42.         throw new NotSupportedException();
  43.     }
  44.  
  45.     public override System.Web.Security.MembershipUser GetUser(object providerUserKey, bool userIsOnline)
  46.     {
  47.         throw new NotSupportedException();
  48.     }
  49.  
  50.     public override string GetUserNameByEmail(string email)
  51.     {
  52.         throw new NotSupportedException();
  53.     }
  54.  
  55.     public override int MaxInvalidPasswordAttempts
  56.     {
  57.         get { throw new NotSupportedException(); }
  58.  
  59.  
  60.     }
  61.  
  62.     public override int MinRequiredNonAlphanumericCharacters
  63.     {
  64.         get { throw new NotSupportedException(); }
  65.  
  66.  
  67.     }
  68.  
  69.     public override int MinRequiredPasswordLength
  70.     {
  71.         get { throw new NotSupportedException(); }
  72.  
  73.  
  74.     }
  75.  
  76.     public override int PasswordAttemptWindow
  77.     {
  78.         get { throw new NotSupportedException(); }
  79.  
  80.  
  81.     }
  82.  
  83.     public override System.Web.Security.MembershipPasswordFormat PasswordFormat
  84.     {
  85.         get { throw new NotSupportedException(); }
  86.  
  87.  
  88.     }
  89.  
  90.     public override string PasswordStrengthRegularExpression
  91.     {
  92.         get { throw new NotSupportedException(); }
  93.  
  94.  
  95.     }
  96.  
  97.     public override bool RequiresQuestionAndAnswer
  98.     {
  99.         get
  100.         {
  101.             if (_requiresQuestionAndAnswer == true)
  102.             {
  103.                 return true;
  104.             }
  105.             else
  106.             {
  107.                 return false;
  108.             }
  109.         }
  110.     }
  111.  
  112.     public override bool RequiresUniqueEmail
  113.     {
  114.         get { return false; }
  115.  
  116.     }
  117.  
  118.     public override string ResetPassword(string username,string answer)
  119.     {
  120.         throw new NotSupportedException();
  121.     }
  122.  
  123.  
  124.     public override bool UnlockUser(string userName)
  125.     {
  126.         throw new NotSupportedException();
  127.  
  128.     }
  129.  
  130.     public override void UpdateUser(System.Web.Security.MembershipUser user)
  131.     {
  132.     }
  133.  
  134.     public override bool ValidateUser(string username, string password)
  135.     {
  136.         OracleConnection conn = new OracleConnection(connStr);
  137.         try
  138.         {
  139.             conn.Open();
  140.             string sql = "Select * From XX_Test_Membership WHERE " + "UserName='" + username + "' AND PWD='" + password + "'";
  141.             OracleCommand comm = new OracleCommand(sql, conn);
  142.             OracleDataReader reader = comm.ExecuteReader();
  143.             if (reader.HasRows)
  144.             {
  145.                 return true;
  146.             }
  147.             else
  148.             {
  149.                 return false;
  150.             }
  151.             conn.Close();
  152.         }
  153.         catch (Exception ex)
  154.         {
  155.             Console.Write(ex.ToString());
  156.             return false;
  157.         }
  158.  
  159.  
  160.     }
  161. }
Mar 13 '07 #3
ceema
4 New Member
Hello All,

I got the reason for the error, I have blocked the lines

connStr = config["connectionString"];
base.Initialize(name, config);


in


System.Collections.Specialized.NameValueCollection config)


Thanks
Ceema
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
//if (config("requiresQuestionAndAnswer") == "true")
//{
// _requiresQuestionAndAnswer = true;
//}
connStr = config["connectionString"];
base.Initialize(name, config);
}
Mar 13 '07 #4
kenobewan
4,871 Recognized Expert Specialist
So do you need help with the connection string?
Mar 13 '07 #5
karthiktss
1 New Member
hi

i try to create membershipprivoder.at run time i getting this type error, find the solution for this error.

Errors

1.'sqlAccessMembershipProvider.CreateUser(string, string, string, string, string, bool, object, ref System.Web.Security.MembershipCreateStatus)': no suitable method found to override

2.'sqlAccessMembershipProvider' does not implement inherited abstract member 'System.Web.Security.MembershipProvider.CreateUser (string, string, string, string, string, bool, object, out System.Web.Security.MembershipCreateStatus)'


Coding

using System;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web;
using System.Web.Security;
using System.Web.Caching;


public class sqlAccessMembershipProvider :MembershipProvider
{
//---for database access use---
private string connStr;
//private OleDb.OleDbCommand comm = new OleDb.OleDbCommand();
private SqlCommand comm = new SqlCommand();

private bool _requiresQuestionAndAnswer;
private int _minRequiredPasswordLength;

public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{

//===retrives the attribute values set in
//web.config and assign to local variables===

if (config("requiresQuestionAndAnswer") == "true")
_requiresQuestionAndAnswer = true;

connStr = config("connectionString");
base.Initialize(name, config);
}

public override string ApplicationName
{
get { }
set { }
}

public override bool ChangePassword(string username, string oldPassword, string newPassword)
{

}

public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
}
public override System.Web.Security.MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, ref System.Web.Security.MembershipCreateStatus status)
// public override bool CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, ref MembershipCreateStatus status)
{
SqlConnection conn = new SqlConnection(connStr);
// OleDb.OleDbConnection conn = new OleDb.OleDbConnection(connStr);
//----perform checking all the relevant checks here
// and set the status of the error accordingly, e.g.:
//status = MembershipCreateStatus.InvalidPassword
//status = MembershipCreateStatus.InvalidAnswer
//status = MembershipCreateStatus.InvalidEmail

//---add the user to the database
try
{
conn.Open();
string sql = "INSERT INTO Membership VALUES (" + "@username, @password, @email, " + " @passwordQuestion, @passwordAnswer )";
OleDb.OleDbCommand comm = new OleDb.OleDbCommand(sql, conn);
comm.Parameters.AddWithValue("@username", username);
comm.Parameters.AddWithValue("@password", password);
comm.Parameters.AddWithValue("@email", email);
comm.Parameters.AddWithValue("@passwordQuestion", passwordQuestion);
comm.Parameters.AddWithValue("@passwordAnswer", passwordAnswer);
int result = comm.ExecuteNonQuery();
conn.Close();
status = MembershipCreateStatus.Success;
MembershipUser user = new MembershipUser("AccessMembershipProvider", username, null, email, passwordQuestion, null, true, false, Now, null,
null, null, null);
return user;
}
catch (Exception ex)
{
//---failed; determine the reason why
status = MembershipCreateStatus.UserRejected;
return null;
}
}

public override bool DeleteUser(string username, bool deleteAllRelatedData)
{

}

public override bool EnablePasswordReset
{

get { }
}

public override bool EnablePasswordRetrieval
{

get { }
}

//public override System.Web.Security.MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, ref int totalRecords)
//{

//}

//public override System.Web.Security.MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, ref int totalRecords)
//{

//}

//public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, ref int totalRecords)
//{

//}

public override int GetNumberOfUsersOnline()
{

}

public override string GetPassword(string username, string answer)
{

}

public override System.Web.Security.MembershipUser GetUser(string username, bool userIsOnline)
{

}

public override System.Web.Security.MembershipUser GetUser(object providerUserKey, bool userIsOnline)
{

}

public override string GetUserNameByEmail(string email)
{

}

public override int MaxInvalidPasswordAttempts
{

get { }
}

public override int MinRequiredNonAlphanumericCharacters
{

get { }
}

public override int MinRequiredPasswordLength
{

get { }
}

public override int PasswordAttemptWindow
{

get { }
}

public override System.Web.Security.MembershipPasswordFormat PasswordFormat
{

get { }
}

public override string PasswordStrengthRegularExpression
{

get { }
}

public override bool RequiresQuestionAndAnswer
{
get
{
if (_requiresQuestionAndAnswer == true)
{
return true;
}
else
{
return false;
}
}
}

public override bool RequiresUniqueEmail
{

get { }
}

public override string ResetPassword(string username, string answer)
{

}

public override bool UnlockUser(string userName)
{

}

public override void UpdateUser(System.Web.Security.MembershipUser user)
{

}

public override bool ValidateUser(string username, string password)
{
OleDb.OleDbConnection conn = new OleDb.OleDbConnection(connStr);
try
{
conn.Open();
string sql = "Select * From Membership WHERE " + "username=@username AND password=@password";
OleDb.OleDbCommand comm = new OleDb.OleDbCommand(sql, conn);
comm.Parameters.AddWithValue("@username", username);
comm.Parameters.AddWithValue("@password", password);
OleDb.OleDbDataReader reader = comm.ExecuteReader;
if (reader.HasRows)
{
return true;
}
else
{
return false;
}
conn.Close();
}

catch (Exception ex)
{
Console.Write(ex.ToString);
return false;
}
}

public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not implemented.");
}

public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not implemented.");
}

public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not implemented.");
}
}
Jan 18 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dabbler | last post by:
Is there a way for me to trap this exception from the LoginControl: "Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the...
1
by: Hayden Kirk | last post by:
Hi Guys, I wish to store user attributes in my own tables on a mssql database. IE, I wish to use an existing table. Can someone point me to a good article on how to go about doing this? I've...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.