.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

About insert query and auto number generation algorithm

Posted By: Karthick     Posted Date: September 21, 2011    Points:5   Category :Sql Server
Hi,
In my project am using receipt number which is auto generated. in client system if anybody saves the reciept it will check the receipt no if it already created, it will automatically insert next number. but if both the client saves record at a time , it saves both the record with the same number, anybody knows please reply as soon ..
Thanks in advance...

Responses
Author: Narayanan             
Posted Date: September 21, 2011     Points: 20   

Hi,
Try this way..
Set receipt no as a Primary key in your database.if you set a primary key .It does not allow Duplicate entries.




Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend