Bug #68095 MySQLMembershipProvider: GetAllUsers returns null anytime
| Submitted: | 16 Jan 2013 7:53 | Modified: | 10 Feb 2013 21:33 |
|---|---|---|---|
| Reporter: | Flavio Oliveira | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | Connector / NET | Severity: | S1 (Critical) |
| Version: | 6.6.4 | OS: | Any |
| Assigned to: | Fernando Gonzalez.Sanchez | CPU Architecture: | Any |
| Tags: | GetAllUsers MySQLMembershipProvider | ||
[16 Jan 2013 7:53]
Flavio Oliveira
[10 Feb 2013 21:33]
Fernando Gonzalez.Sanchez
Hi, I can't repeat the claim that this method always returns an empty list. Can you provide more details on how to repro? For instructions follow this link: http://dev.mysql.com/doc/refman/5.0/en/connector-net-website-config.html or for configuring manually follow: http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-asp-provider.html As another full example, you can also check unit test MySql.Web.Tests.UserManagement.GetAllUsers at Connector/NET 6.6.4 source code.
[25 Oct 2014 20:48]
Michael Gilbert
protected void Page_Load(object sender, EventArgs e)
{
string current = string.Empty;
// Get user info
using (MySqlConnection connection = new MySqlConnection(Host_Procedures.GetConfigConnStr("LocalMySqlServer")))
{
connection.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT firstname, lastname FROM my_aspnet_users WHERE id=1;", connection))
{
using (MySqlDataReader rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
if (!rdr.IsDBNull(0))
current = rdr.GetString(0);
if (!rdr.IsDBNull(1))
current += " -- " + rdr.GetString(1);
}
}
}
}
MembershipProvider provider = Membership.Provider;
MembershipUserCollection users = Membership.GetAllUsers();
}
// code from Login Page_Load.
// I get the user id=1 so I know the database connection is good.
// On some computers the users show up, on others none. Same database,
// sometimes on a server, sometimes locally. It is the database, because
// on 2 of my computers I get 0 for local, but get numbers when I point to
// a server.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.