Hi There,
To access session, all you need to do it:
example:
SqlConnection scon = New SqlConnection(Session("ConnectionPath") );
The above method is not recommended, you can store your connectionstring in web.config
example:
1) Add connection string to web.config
<?xml version="1.0"?>
<
configuration>
<
.....
<connectionStrings>
<
add name="MyConnectionString" connectionString="Data Source=localhost;Initial Catalog=DatabaseName;Persist Security Info=True;User ID=Username;Password=Password" providerName="System.Data.SqlClient"/>
</
connectionStrings>
2) Get connectionstring from web.config
sqlConnection sConn =
new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
To secure connectionstring in web.config
http://msdn2.microsoft.com/en-us/library/dx0f3cf2(VS.80).aspx