Click here to Skip to main content
16,022,542 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have created the Admin Page in that Add User,Edit User,Block User and Delete User.
In that admin is having permission for both Adding,Editing,Blocking and Deleting user.I have created the code for adding and editing. I don't know how to write the coding for Deleting and blocking.


Regards
Balamurugan
Posted

hi,

check out the following link[^]
 
Share this answer
 
There is a simple way to block a user,In the database add a column with datatype bool ....add true to the column if you want to give access to the user and false if you want to block the user....
Then write query as....


con.Open();
cmd = new SqlCommand("select count(*) from USERS where username= + txt_username.Text + and password=+ txt_password.Text + ; and bool_status=true , con);
int i = (int)cmd.ExecuteScalar();



if (i == 0)
{
userblocked
}
else
{
valid
}
simple.................
 
Share this answer
 
v2

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