Author: dolittle | Posted on: 4/8/2009 6:18:40 AM | Views : 496

Days I've spent to find out what was going on. Incredibly my createwizard user
control adds a user but on the createduser event I have the following code
because I want to get the ProviderUserKey for the just created user.



Running the reader returns null records because this same code deletes the user
just added. Does anyone have a faintest idea what is going on?



on createduser event...



string uid = CreateUserWizard1.UserName;



string connect = ConfigurationManager.ConnectionStrings["xcon"].ConnectionString;



string sqlStatement = "SELECT UserID,UserName FROM aspnet_Users WHERE UserName=@uid";

SqlConnection myconnect = new SqlConnection();

myconnect.ConnectionString = connect;

SqlCommand com = new SqlCommand(sqlStatement, myconnect);



SqlParameter User = new SqlParameter();

User.ParameterName = "@uid";

User.Value = uid;
Go to the complete details ...