Hi, I am brand new to ASP.NET, and even web development. I am trying to write an application that allows the user to manipulate a server database, and I've been following the walkthroughs and have had moderate, although hard-fought, success. I am using VB ASP.NET.
Now that I am successfully reading and writing data using SQL connection, DataGrid, etc (using the walkthroughs)., my instinct (being a normal windows developer) is to write a mydatabase class to encapsulate the work that needs to be done to initialize, terminate, query for or update my specific tables, etc; and to have my various pages call to this class when it needs to use the data (I'll have 5-10 pages on my site that need to look up or update a variety of data in a variety of ways).
Is this the right approach? Is it even possible to have an app-wide global object (my proposed DB class) that is always there? I see how I can create a class (project->Add class), but I actually don't see how to reference it from the codebehinds of any (much less all) of my pages.
Anyway, any thoughts on how to architect a database-interactive VB ASP.NET site would be helpful. I'll spread the points around to any useful answers. Thanks a lot!