Afternoon All,
I have a web site where i need to know who is inserting a record into my database table. I have a group of users which i have populated into an Active Directory (AD) group and in turn they are the only members able to access the site. (See web.config code and .vb code below)
'Config File
<appSettings>
<add key="dbConnection" value="Data Source=xxx;Initial Catalog=xxx;User ID=xxx;Password=xxx;"/>
<add key="Users" value="Users_General_Access"/>
</appSettings>
'Vb Code
If User.IsInRole(ConfigurationManager.AppSettings("Users")) Then
Else
Response.Redirect("NotAuthorised.aspx")
End If
I have a stored procedure that is used to insert data from my form fields into the database which work fine.
The problem that i have is that im not asking the user to log in as they are able to do so via the AD set up. However i need to caputre the username so i can populate this into my database table to state who has added that record.
Is there some VB code that i can use to obtain this information?
Many thanks in advance Betty.