Click here to Skip to main content
15,896,063 members
Articles / Web Development / ASP.NET

duplicate name not allow

Rate me:
Please Sign up or sign in to vote.
1.00/5 (1 vote)
11 Jan 2013CPOL 0  
You can check usingstring sql = string.format(" select count(*) from table name where name='{0}'", txtname.text);if it exitst it gives 1 else 0then u can allow to enter.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
11 Jan 2013Member 9511889 2 alternatives  
i have 'user' table:fields are:nameemailidaddressph.nopasswordwhen i insert new data from textbox,it will check whether name is allready exsist or not .if not exsist then allow to enter name in textbox.how to do this?more discription of my problem:when i enter...
Please Sign up or sign in to vote.
11 Jan 2013Shubh Agrahari
Hi Friend..on insertion button click event just do this... con.Open(); MySqlCommand cmd = new MySqlCommand("select * from Your_tableUser where name='"+txtboxName.text+"'", con); MySqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { ...

License

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


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions