reeftec
asked on
Using SQL inl Global.asax to set a session value
How do I use the global.asax file to establish a session value that is obtained from a sql database. The connect string is contained in the web.config file.
The sql query would be similar to this: select empl_id from employee
Where session.contents ("username") = employee.user_name.
Session.contents("userid") = employee.empl_id
The sql query would be similar to this: select empl_id from employee
Where session.contents ("username") = employee.user_name.
Session.contents("userid")
The global.asax file currently contains the following:
<%@ Application Language="VB" %>
<script runat="server">
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User
Dim username As String
username = User.Identity.Name
Session.Contents("username") = User.Identity.Name
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.