Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i got this code from internet but i cant understand the meaning of below code.
please give the meaning of this code ...

C#
if (rows == -1) rows = registered.Count();
         int pageSize = rows ?? 2;
Posted
Updated 6-Mar-14 22:04pm
v2
Comments
Ramug10 7-Mar-14 2:18am    
What you want to do? Why you require this code?
An@nd Rajan10 7-Mar-14 2:28am    
just i want to know about the meaning, i thing this code is used to insert data into table
this is right or not???
Maciej Los 7-Mar-14 2:33am    
Code dump!
Legor 7-Mar-14 3:19am    
Your question is impossible to answer without knowing all those types used therere. E.g. how is Membership declared, of what type is model, what is the signature of CreateUser() etc. ? Nobody can work out what is happening in your code with this little information.

Create User is a Function in Membership class
and Membership can be the object of that class

model can be the property in the model layer i mean the specific class.
 
Share this answer
 
Comments
An@nd Rajan10 7-Mar-14 2:22am    
createuser is predefined class ?? or not ??
An@nd Rajan10 7-Mar-14 2:26am    
i thing this code is used to insert data into table i am right??
@andrew
Hey Anand,

I think you are working on MVC. It's not inserting the data into the table, actually it's checking the authenticity of user.

Membership is a class and CreateUser is an object. "model" is representing your model in which these properties would be created :- "UserName, Password and Email".

so it's associating those properties with the value provided by the user.

If the user is found to be authentic then his account/status would be shown.
 
Share this answer
 
v2
Adds a new user with specified property values and a unique identifier to the data store and returns a status parameter indicating that the user was successfully created or the reason the user creation failed.
C#
public static MembershipUser CreateUser(
    string username,
    string password,
    string email,
    string passwordQuestion,
    string passwordAnswer,
    bool isApproved,
    Object providerUserKey,
    out MembershipCreateStatus status
)


Parameters
usernameType: System.String

The user name for the new user.
passwordType: System.String

The password for the new user.
emailType: System.String

The e-mail address for the new user.
passwordQuestionType: System.String

The password-question value for the membership user.
passwordAnswerType: System.String

The password-answer value for the membership user.
isApprovedType: System.Boolean

A Boolean that indicates whether the new user is approved to log on.
providerUserKeyType: System.Object

The user identifier for the user that should be stored in the membership data store.
statusType: System.Web.Security.MembershipCreateStatus

A MembershipCreateStatus indicating that the user was created successfully or the reason creation failed.


Return Value
Type: System.Web.Security.MembershipUser
A MembershipUser object for the newly created user. If no user was created, this method returns null.

SQL
CreateUser adds a new user to the data store and returns a MembershipUser object for the newly created user. If the user creation fails, you can retrieve a MembershipCreateStatus value from the status output parameter that indicates why user creation failed. You can specify a unique identifier for the user, such as a primary key value for a database, by using the providerUserKey parameter.

The CreateUser method will return null if password is an empty string or null, username is an empty string or null or contains a comma (,), passwordQuestion is not null and contains an empty string, or passwordAnswer is not null and contains an empty string.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900