ASP.Net: How to log login-trys correctly? -


i have login in admin page.

now want log every login-try in database. normaly have log-table adminid in foreign key of adminuser-table.

now, of course, when try login username doesn't exist, haven't id , foraign-key uses crash in write-attamp.

now whats correct way log login-try when username isn't correct , haven't correct id?

1) add second log-table such things or 2) remove foraign key in first log-table

why not have adminid field nullable field? way, distinguish between successful , unsuccessful login attempts.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -