Global database declaration
-
Is there any way of being able to open a database at the begging on a page, and close it at the end, where "#include file=..." have been used? I'm currently having problem with declaration blocks etc? I've been told the global.asax however this hasn't worked
-
Is there any way of being able to open a database at the begging on a page, and close it at the end, where "#include file=..." have been used? I'm currently having problem with declaration blocks etc? I've been told the global.asax however this hasn't worked
You would be better creating a DAL that maintains the connection information then for each database query have it open the connection, process the query, and then close the connection. You can then share the DAL across many pages which removes your need to store any kind of database information in the page classes.
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website
-
You would be better creating a DAL that maintains the connection information then for each database query have it open the connection, process the query, and then close the connection. You can then share the DAL across many pages which removes your need to store any kind of database information in the page classes.
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." My website
Thanks for you reply, I'm not too keen on the concept from what I've looked into. I'm very old fashioned about databases and tend to use a classic ASP approach. Any suggestions on how I could use simply a globally declared application, or what the rules and capabilities are surrounding shared variables using "#include", because some pages share variables from one page to the next, but others don't. Cheers