Click here to Skip to main content
15,904,935 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading Substring Pin
Simon P Stevens30-Sep-08 1:11
Simon P Stevens30-Sep-08 1:11 
GeneralRe: Reading Substring Pin
omlac30-Sep-08 1:13
omlac30-Sep-08 1:13 
QuestionHow to maintain richtextbox selection when focus is moved to another control? Pin
kohwo30-Sep-08 0:19
kohwo30-Sep-08 0:19 
AnswerRe: How to maintain richtextbox selection when focus is moved to another control? Pin
Simon P Stevens30-Sep-08 0:20
Simon P Stevens30-Sep-08 0:20 
GeneralRe: How to maintain richtextbox selection when focus is moved to another control? Pin
kohwo30-Sep-08 1:02
kohwo30-Sep-08 1:02 
GeneralRe: How to maintain richtextbox selection when focus is moved to another control? Pin
Simon P Stevens30-Sep-08 1:17
Simon P Stevens30-Sep-08 1:17 
QuestionLooking for a C# function to increment the existing user table by 1. Pin
Member 352630330-Sep-08 0:17
Member 352630330-Sep-08 0:17 
AnswerRe: Looking for a C# function to increment the existing user table by 1. Pin
Simon P Stevens30-Sep-08 0:37
Simon P Stevens30-Sep-08 0:37 
You could redefine the columns to be automatically incrementing numbers. You use the "IDENTITY(x,y)" command when defining the table. (x = start, y = increment value).

e.g.
CREATE TABLE TableName 
         (UserId INT IDENTITY(1,1) NOT NULL,
          UserName VARCHAR(50) NOT NULL,
          Password VARCHAR(50) NOT NULL)


(Or using the GUI, you can set the Identity Specification property of the column to yes, and set the seed and increment there).

Personally though, using an autonumber as the primary key for a user isn't a very good design. Instead, I would define the primary key of a user as a "uniqueidenitifer" type (in SQL) and use guids in C#. Then, when you need to create a new user, you can call Guid.NewGuid() to create a new guid value that you use for that user.

Good luck.

Simon

GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Member 352630330-Sep-08 1:04
Member 352630330-Sep-08 1:04 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
leppie30-Sep-08 1:11
leppie30-Sep-08 1:11 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Simon P Stevens30-Sep-08 1:16
Simon P Stevens30-Sep-08 1:16 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Simon P Stevens30-Sep-08 1:16
Simon P Stevens30-Sep-08 1:16 
AnswerRe: Looking for a C# function to increment the existing user table by 1. Pin
Ashfield30-Sep-08 1:27
Ashfield30-Sep-08 1:27 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Simon P Stevens30-Sep-08 2:00
Simon P Stevens30-Sep-08 2:00 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Ashfield30-Sep-08 2:11
Ashfield30-Sep-08 2:11 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Simon P Stevens30-Sep-08 4:13
Simon P Stevens30-Sep-08 4:13 
GeneralRe: Looking for a C# function to increment the existing user table by 1. Pin
Ashfield30-Sep-08 9:36
Ashfield30-Sep-08 9:36 
AnswerRe: Looking for a C# function to increment the existing user table by 1. Pin
Pete O'Hanlon30-Sep-08 2:06
mvePete O'Hanlon30-Sep-08 2:06 
QuestionPrint Window Pin
PaulaM30-Sep-08 0:09
PaulaM30-Sep-08 0:09 
AnswerRe: Print Window Pin
Giorgi Dalakishvili30-Sep-08 0:16
mentorGiorgi Dalakishvili30-Sep-08 0:16 
AnswerRe: Print Window Pin
leppie30-Sep-08 0:33
leppie30-Sep-08 0:33 
GeneralRe: Print Window Pin
PaulaM30-Sep-08 0:40
PaulaM30-Sep-08 0:40 
GeneralRe: Print Window Pin
leppie30-Sep-08 1:10
leppie30-Sep-08 1:10 
GeneralRe: Print Window Pin
Giorgi Dalakishvili30-Sep-08 0:52
mentorGiorgi Dalakishvili30-Sep-08 0:52 
QuestionWMI Pin
arkiboys30-Sep-08 0:06
arkiboys30-Sep-08 0:06 

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.