Modules in ASP.NET pages
-
Is this possible in ASP.NET in Visual Studio 2005. I want to create a web site that contains about 4 pages. The data for each page is stored on a SQL Server 2005 database. The ConnectionString is always the same, but the SelectCommand will differ depending on that page's function. Can't I place these instructions into a global module on the web site and have them called when needed? If this is possible, how do I create a VB module on the web site? Thank you, Quecumber256
-
Is this possible in ASP.NET in Visual Studio 2005. I want to create a web site that contains about 4 pages. The data for each page is stored on a SQL Server 2005 database. The ConnectionString is always the same, but the SelectCommand will differ depending on that page's function. Can't I place these instructions into a global module on the web site and have them called when needed? If this is possible, how do I create a VB module on the web site? Thank you, Quecumber256
Hey Quecumber256, VB modules are not recommended in .NET world. But you can still create a module of your own. Just click Add New Item and add a class file. Then clear the file and add
Public Module MODULENAME
End MODULENAME
Don't try to change the extension. The file extension should be .vb only. Another solution: If you are going to store only the ConnectionString info then use Web.Config file which is recommended by .NET. If you want to remember any objects try Sessions. Have a nice day man...
Regards, Venkatesh Mookkan. Software Engineer
-
Is this possible in ASP.NET in Visual Studio 2005. I want to create a web site that contains about 4 pages. The data for each page is stored on a SQL Server 2005 database. The ConnectionString is always the same, but the SelectCommand will differ depending on that page's function. Can't I place these instructions into a global module on the web site and have them called when needed? If this is possible, how do I create a VB module on the web site? Thank you, Quecumber256
-
Is this possible in ASP.NET in Visual Studio 2005. I want to create a web site that contains about 4 pages. The data for each page is stored on a SQL Server 2005 database. The ConnectionString is always the same, but the SelectCommand will differ depending on that page's function. Can't I place these instructions into a global module on the web site and have them called when needed? If this is possible, how do I create a VB module on the web site? Thank you, Quecumber256
Hi , Store the ConnectionString in web.Config's AppSetting .Add a new class(note this is not amodule) and write your functions to retrieve the data from database .IN code behind page , call the methods from the class to display the records into page.
Vicky