AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 how to generate automatic number
Posted by abhi on  6/26/2009 12:29:30 AM Category: ADO.NET
Add to my favorites
Email to friend
how to generate automatic number like 05b61f001,05b61f002

Post Your Reply Post New Question

 Viewer's Reply
Use random number function
Answered By Salinee sachan on 6/26/2009 6:02:41 AM
Public Function RandomNumber(ByVal MaxNumber As Integer, Optional ByVal MinNumber As Integer = 0) As Integer
'initialize random number generator
Dim r As New Random(System.DateTime.Now.Millisecond)
'if passed incorrect arguments, swap them
'can also throw exception or return 0
If MinNumber > MaxNumber Then
Dim t As Integer = MinNumber
MinNumber = MaxNumber
MaxNumber = t
End If
Return r.Next(MinNumber, MaxNumber)
End Function
this function return a number between min and max value hope this help you
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Many .NET teams are underperforming, is yours?
Integrating Silverlight 4 with SharePoint 2010 - Free 42 Page Sample Chapter
Programmers Heaven C# School Book - Free 338 Page eBook