Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All ,

Have a good Day !! My project is based upon Asp.net,c#,SqlServer 2005.

I have Registration form i which i have Fields as,

FirstName, LastName,UserName, Password etc etc.

So, when the user fill ups this Form, when he is entering Username. It should check automatically that this username Exists or not. when user is entering in textbox , it should check the database.and displays a message in label.

if its already exists in Database, it must show already exists(Someone already choosed, Try another)

Please give me good solution for this problem.

Thanks.
Posted

Any efforts? This has been do so many times and internet is full of examples of it.
Microsoft even ships the Login Control with so that you don't have do it all over again. Look at the following links:

http://msdn.microsoft.com/en-us/library/ms178329.aspx[^]

http://www.asp.net/web-forms/tutorials/security/membership/creating-user-accounts-cs[^]

http://geekswithblogs.net/dotNETvinz/archive/2009/04/30/creating-a-simple-registration-form-in-asp.net.aspx[^]
 
Share this answer
 
Comments
Shahin Khorshidnia 9-Jul-12 5:59am    
+5 And a simple way: Select * from [User] where UserName = 'The user Name'
Ubaid ur Rahman IT 9-Jul-12 6:03am    
Boss, I need to check the Users Check Availability from Database, whether its Exists of not.

Please help me.

Thanks.
vangapally Naveen Kumar 9-Jul-12 6:03am    
Good Links
Prasad_Kulkarni 16-Jul-12 23:59pm    
Good references +5!
Plz go through this link. Here webservice call is on button click. Instead use it in textbox onblur event.
How to call a Web Service from client-side JavaScript using ASP.NET AJAX
 
Share this answer
 
Checking User is present in Db or Not

Select Usenname from Users ;
Then Compare With User entered Username with Db UserName
Like This
C#
Sqlconnection con=new sqlconnection(Your connection string);
Sqldataadapter da=new Sqldataadapter("Select Usenname from Users",con);
dataset ds=new dataset();
if(textbox1.text==ds.tables[0].rows[0][0].tostring())
{
lblmsg.Text="Please Choose another User"
}
else
{
//Proceed

}
 
Share this answer
 
Comments
samlee69 21-Sep-16 3:22am    
where should i put this code at page load or at onclick event?????????
 
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