User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,624 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,184 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 14163 | Replies: 10
Reply
Join Date: Nov 2005
Location: Mountain View, CA
Posts: 47
Reputation: kedar_challa is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
kedar_challa's Avatar
kedar_challa kedar_challa is offline Offline
Light Poster

Re: How to auto increment?

  #11  
Nov 10th, 2005
Originally Posted by Paladine
Didn't say that.

Ok, i got it.
First we have to check for the records in the database.

Select count(*) from users;


If the number of records is zero. Then ask the user to enter the initial value.
Check whether it is alphanumeric or numeric using RegEx class.

[HTML]
Regex regex = new Regex("^[a-zA-Z]");

string str = "CAN00001";

regex.IsMatch(str);



[/HTML]

and follow the method i described to increment the alphanumeric value.
Thanks,

KedarNath Challa
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 1:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC