Archive for July 11, 2006

An open-source ASP.NET menu server control

skmMenu is a simple and free ASP.NET menu server control. It uses XML file as back end. Really cool control.

Visit skmMenu website

Advertisements

July 11, 2006 at 6:36 am 3 comments

ASP.NET: Connection Strings

In ASP.NET there are several options for storing connection strings. These include the Web.config file, Application variables, custom text files, and hardcoded into pages or components. In Classic ASP, it was common practice to use the Application object to store the connection string information for an application, so it was common to find code like this in the global.asa file:

Sub Application_OnStart
	Application("Conn1_ConnectionString") = _
	"Provider=SQLOLEDB.1;UID=sa;PWD=p;Initial
		Catalog=src;Data Source=localhost;"
End Sub

This was the “best practice” approach for many websites. Another option that some sites, such as ASPAlliance.com, used was to have these settings in a common text file that was then called with Server.Execute, such as this:

Sub Application_OnStart
	Server.Execute "/db/config.asp"
End Sub

This would allow many different applications (like all of the individual columnists on ASPAlliance.com) to have their connection information stored in one place. ASPAlliance also used a COM object’s property for this same purpose for a while. The question is, what’s the best way to store this information in ASP.NET?Well, there is no single right answer for this question, but depending on your situation, there is usually a method that is best. Before we consider the different possibilities, let’s consider one option that should probably be eliminated right away: Application variables.

(more…)

July 11, 2006 at 5:06 am 1 comment


Top Clicks

  • None

Calendar

July 2006
M T W T F S S
    Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Recent Posts

Feeds

Blog Stats

  • 93,152 hits