Passing LOGON USER to the DB

  • Thread starter Thread starter Patrick Olurotimi Ige
  • Start date Start date
P

Patrick Olurotimi Ige

How can i send LOGON_USER or User.Identity.Name to the Database?
I'm working on a survey which is intranet based with Windows
Authentication.
I can get the current user by calling LOGON_USER or User.Identity.Name !
But i want to pass(the current user) to a table in DB!
I was thinking of ussing hidden textboxes like so :-
Is it a good approach..
Any ideas appreciated!
 
Hi Patrick, you question is actually fairly broad. Perhaps you can narrow
in on some specifics.

It sounds like you're able to access the current user information without
problem, so I'm assuming your question is database related.

What are you attempting to accomplish with the current user name and your
database?
 
Thanks MWells for the reply.
Exactly i can get the current user but i want to send the current user data
to the database.
I was thinking of using hidden input t text box like so
<input type="hidden" runat="server">
So what i want to do is at the end of the SURVEY(by clicking the submit
button) i want to capture the current user USING WINDOWS
AUTH(<%=User.Identity.Name%> and then send it to a table in the database!
Hope it is clear..







How can i send LOGON_USER or User.Identity.Name to the Database?
I'm working on a survey which is intranet based with Windows
Authentication.
I can get the current user by calling LOGON_USER or User.Identity.Name !
But i want to pass(the current user) to a table in DB!
I was thinking of ussing hidden textboxes like so :-
<input type="hidden" runat=server>
Is it a good approach..???
** I want the SUBMIT button at the end of the survey to send the LOGON_USER
(using LOGON_USER or User.Identity.Name) to a table in the database!
Any ideas appreciated!
Pls forward any resources available!
 
Pretty much all you're facing, then, is getting your data into the database.
I don't see how a hidden field would give you any value; you just take
User.Identity.Name, and insert it into your database.

Take a look at the System.Data namespace; for example if you're using Sql
Server, you'll be using System.Data.SqlClient. The specifics of how and
when you do the insert are driven by your database schema and how your
business logic is organized.
 
Back
Top