Click here to Skip to main content
15,889,462 members
Home / Discussions / C#
   

C#

 
Generalformatting text Pin
samoore22-Aug-05 6:07
samoore22-Aug-05 6:07 
GeneralRe: formatting text Pin
Guffa22-Aug-05 6:20
Guffa22-Aug-05 6:20 
GeneralRe: formatting text Pin
samoore22-Aug-05 6:28
samoore22-Aug-05 6:28 
GeneralRe: formatting text Pin
Robert Rohde22-Aug-05 8:47
Robert Rohde22-Aug-05 8:47 
GeneralRe: formatting text Pin
Christian Graus22-Aug-05 10:59
protectorChristian Graus22-Aug-05 10:59 
GeneralRe: formatting text Pin
samoore22-Aug-05 11:34
samoore22-Aug-05 11:34 
QuestionTest Network Services with C#? Pin
jkersch22-Aug-05 5:49
jkersch22-Aug-05 5:49 
Generalc# newbie problem Pin
talk2krish22-Aug-05 4:34
talk2krish22-Aug-05 4:34 
GeneralRe: c# newbie problem Pin
Judah Gabriel Himango22-Aug-05 4:59
sponsorJudah Gabriel Himango22-Aug-05 4:59 
GeneralOnEnter Event Pin
Agyeman22-Aug-05 4:07
Agyeman22-Aug-05 4:07 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 4:32
miah alom22-Aug-05 4:32 
GeneralRe: OnEnter Event Pin
Agyeman22-Aug-05 5:01
Agyeman22-Aug-05 5:01 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 5:02
miah alom22-Aug-05 5:02 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 5:59
miah alom22-Aug-05 5:59 
GeneralRe: OnEnter Event Pin
Agyeman22-Aug-05 8:02
Agyeman22-Aug-05 8:02 
GeneralRe: OnEnter Event Pin
nidhelp22-Aug-05 22:02
nidhelp22-Aug-05 22:02 
GeneralRe: OnEnter Event Pin
Agyeman23-Aug-05 2:44
Agyeman23-Aug-05 2:44 
GeneralRe: OnEnter Event Pin
Agyeman23-Aug-05 2:49
Agyeman23-Aug-05 2:49 
GeneralRe: OnEnter Event Pin
nidhelp23-Aug-05 5:46
nidhelp23-Aug-05 5:46 
Generalaccess autonincrement question Pin
theStorminMormon22-Aug-05 3:58
theStorminMormon22-Aug-05 3:58 
GeneralRe: access autonincrement question Pin
Guffa22-Aug-05 5:38
Guffa22-Aug-05 5:38 
GeneralRe: access autonincrement question Pin
theStorminMormon22-Aug-05 5:43
theStorminMormon22-Aug-05 5:43 
GeneralRe: access autonincrement question Pin
miah alom22-Aug-05 5:57
miah alom22-Aug-05 5:57 
Using identity column is not a good idea. There are many problems associated one being identity gap. I think you should implement your own increment procedure.

Have a table with the follwoing schema

CREATE TABLE dbo.Sequence
(
TableName varchar(30) NOT NULL,
NextVal int NOT NULL
)
LOCK DATAROWS
go

GetSequence should get you the id

CREATE PROCEDURE GetSequence (
@tbl varchar(30))
AS
DECLARE @nextval int
BEGIN
BEGIN TRAN
UPDATE Sequence
SET NextVal = NextVal + 1
WHERE TableName = @tbl

IF @@rowcount = 1
SELECT @nextval = NextVal
FROM Sequence
WHERE TableName = @tbl
COMMIT TRAN
SELECT @nextval
END

This will work even if there are 100 concurrent users
GeneralRe: access autonincrement question Pin
Guffa22-Aug-05 6:38
Guffa22-Aug-05 6:38 
GeneralHorizontal Scroll Bar Pin
zaboboa22-Aug-05 3:47
zaboboa22-Aug-05 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.