5
Contributors
7
Replies
9
Views
6 Years
Discussion Span
Last Post by glennt
1

for creating the session "global.asax" file is right,
when you creating the session u must wright the code "Session["sec"] = 0" inside the Session_Start () function.
and for connection the web.config is right for connection string code is

<connectionStrings>
      <remove name="conn"/>
      <add name="conn" connectionString="Data Source=.;Initial Catalog=addbook;Integrated Security=True" providerName="System.Data.SqlClient"/>
    
  </connectionStrings>

Edited by Ezzaral: Do not manually post &quot;fake&quot; signatures in your posts. Instead, you may create a sitewide signature within the user control panel.

0

Okay, thanks. But If I could only choose one of three objects (Application, Session or Items) then which one would be the best solution ?

1

Its not good practice to store connection in Memory for ASP.NET.
Make data layer which will connect to DB.
best practice keep Connection Pool so connection are not reopened all time(if frequent visit of database/multiple user)
Check http://www.15seconds.com/issue/040830.htm

Edited by Ezzaral: Do not manually post &quot;fake&quot; signatures in your posts. Instead, you may create a sitewide signature within the user control panel.

0

I have never seen the "remove" code in the connection strings area. What is this needed for?

for creating the session "global.asax" file is right,
when you creating the session u must wright the code "Session["sec"] = 0" inside the Session_Start () function.
and for connection the web.config is right for connection string code is

<connectionStrings>
      <remove name="conn"/>
      <add name="conn" connectionString="Data Source=.;Initial Catalog=addbook;Integrated Security=True" providerName="System.Data.SqlClient"/>
    
  </connectionStrings>

http://infynet.wordpress.com

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.