preCharge Forums - View Single Post - How to declared the Global variables in web.config in asp.net ?
View Single Post
Old 07-10-2006   #4 (permalink)
Minakshi
Junior Member
 
Join Date: Jul 2006
Age: 39
Posts: 8
Default

You can use application variables

'To store a variable:
Application.Lock()
Application("MyVar")="whatever"
Application.Unlock()

'to retrieve the variable:
Dim s as String = Application("MyVar").ToString()


or use key in appSettings. You can even use SQL queries:

First, include this in your web.config :

<appSettings>
<add key="myquery1" value="SELECT * FROM dbo WHERE"/>
</appSettings>

Then, retrieve it with this :

Dim myquery1 As String = System.Configuration.ConfigurationSettings.AppSett ings("myquery1")
Minakshi is offline   Reply With Quote

 
Myspace Layouts | Inkjet Printer | Debt Consolidation | Apply for Credit Card | Debt Consolidation