Passing LOGON USER to the DB

  • Thread starter Patrick Olurotimi Ige
  • 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!
 
M

MWells

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?
 
P

Patrick.O.Ige

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!
 
M

MWells

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top