Click here to Skip to main content
15,921,156 members
Home / Discussions / Database
   

Database

 
GeneralRe: Creating an ADO _RecordsetPtr Pin
Rob Graham19-Aug-04 9:51
Rob Graham19-Aug-04 9:51 
GeneralStoring an image in a sql server db Pin
Rashid_Mehmood17-Aug-04 10:33
Rashid_Mehmood17-Aug-04 10:33 
GeneralRe: Storing an image in a sql server db Pin
S Sansanwal17-Aug-04 12:10
S Sansanwal17-Aug-04 12:10 
GeneralGeneral Database Question Pin
Anonymous17-Aug-04 10:14
Anonymous17-Aug-04 10:14 
GeneralRe: General Database Question Pin
S Sansanwal17-Aug-04 12:25
S Sansanwal17-Aug-04 12:25 
General3 database questions Pin
Chodici Mrkev16-Aug-04 10:16
Chodici Mrkev16-Aug-04 10:16 
GeneralRe: 3 database questions Pin
Christian Graus16-Aug-04 11:32
protectorChristian Graus16-Aug-04 11:32 
GeneralRe: 3 database questions Pin
Colin Angus Mackay18-Aug-04 5:33
Colin Angus Mackay18-Aug-04 5:33 
1. For security you should always store the passwords in an encrypted form. When the user registers for the first type encrypt the password. When the user logs in on subsequent sessions encrypt the password again and search for the encrypted version of the password.
SELECT COUNT(*) FROM myRegistrationTable WHERE UserName=@userName AND EncryptedPassword=@encryptedPassword
The above code will return 0 if the user name and password cannot be found, or 1 otherwise. If it returns any other value the database contains duplicate information.

2. You can apply a unique constraint to the table to ensure that no duplicates are entered. Also the primary key is by default a unique value - so sufficient uniqueness may already be covered. If you do this SQL Server will raise an error when you perform your insert and you can pick this up in your .NET application by catching the SqlException that is generated.

You could also write a stored procedure that checks for the existance of a record first then conditionally inserts the new record if there isn't one already.

3. Use the DELETE command.

Does this help?


"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!


GeneralSync mobile with Oracle Pin
Richard Jones16-Aug-04 7:10
Richard Jones16-Aug-04 7:10 
GeneralConnect to oracleDB Pin
DuckFace16-Aug-04 0:43
DuckFace16-Aug-04 0:43 
GeneralRe: Connect to oracleDB Pin
Michael P Butler16-Aug-04 5:52
Michael P Butler16-Aug-04 5:52 
GeneralRe: Connect to oracleDB Pin
DuckFace17-Aug-04 1:46
DuckFace17-Aug-04 1:46 
QuestionIs ADO thread safe ? Pin
Hesham Amin14-Aug-04 19:39
Hesham Amin14-Aug-04 19:39 
AnswerRe: Is ADO thread safe ? Pin
Mike Dimmick18-Aug-04 3:03
Mike Dimmick18-Aug-04 3:03 
GeneralRe: Is ADO thread safe ? Pin
Hesham Amin18-Aug-04 7:14
Hesham Amin18-Aug-04 7:14 
GeneralSQL Query Performance question Pin
brdavid14-Aug-04 4:43
brdavid14-Aug-04 4:43 
GeneralRe: SQL Query Performance question Pin
Colin Angus Mackay15-Aug-04 10:26
Colin Angus Mackay15-Aug-04 10:26 
GeneralRe: SQL Query Performance question Pin
brdavid15-Aug-04 11:47
brdavid15-Aug-04 11:47 
GeneralRe: SQL Query Performance question Pin
Colin Angus Mackay15-Aug-04 12:10
Colin Angus Mackay15-Aug-04 12:10 
GeneralRe: SQL Query Performance question Pin
brdavid15-Aug-04 15:05
brdavid15-Aug-04 15:05 
GeneralRe: SQL Query Performance question Pin
Anonymous23-Aug-04 7:58
Anonymous23-Aug-04 7:58 
GeneralRe: SQL Query Performance question Pin
brdavid28-Aug-04 6:16
brdavid28-Aug-04 6:16 
QuestionC# SQL INSERT String??? Pin
gman4413-Aug-04 12:16
gman4413-Aug-04 12:16 
AnswerRe: C# SQL INSERT String??? Pin
Colin Angus Mackay13-Aug-04 12:47
Colin Angus Mackay13-Aug-04 12:47 
GeneralRe: C# SQL INSERT String??? Pin
gman4415-Aug-04 4:03
gman4415-Aug-04 4:03 

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.