Re: Read Configuration



Mattias Sjögren wrote:
Could somebody give and example of how to do it ?


System.Configuration.ConfigurationSettings.AppSettings("Desvio")



Thanks for your reply.

I did in that way but it didn't worked and I'm going to be crazy !>..

I did:

Dim ConnectionString As String
	Dim MargenString As String
	Dim Desvio As String

	Desvio =  System.Configuration.ConfigurationSettings.AppSettings("Desvio")
	System.Console.WriteLine(Desvio)

MargenString = System.Configuration.ConfigurationSettings.AppSettings("MargenString")
System.Console.WriteLine(MargenString)

ConnectionString = System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")
System.Console.WriteLine(ConnectionString)


--------------

and in config file I've:

<configuration>
    <appSettings>
	<add key="Desvio" value="652825616" />
	<add key="MargenString" value="10" />
    </appSettings>
</configuration>



But when I run my application I see:

---------
C:\tmp1>.\pruebaSQL.exe


Network Library=DBMSSOCN;Data Source=localhost;Initial atalog=segex;User ID=sa;Password=sa
----------------



Program showed me the string of a parameter I deleted from config file and didn't show me exsitent parameters !!!


How is posible ? Am I doing something wrong ? Is there a kind of cache that keeps data ?

Thanks in advance

X



.



Relevant Pages

  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)
  • Auto Write Name and Merge across
    ... Dim Sheetname01 As String ... Dim WeekName01 As String ...
    (microsoft.public.excel.misc)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Help answer these 70-310 questions
    ... One argument is the string ... Dim output As New StringBuilder ... EmployeeLocations. ... You create a strongly named serviced component. ...
    (microsoft.public.cert.exam.mcsd)