S
Stacey
I am using Visual Studio 2005, creating a VB.NET program. I am have created
a settings file and two settings in the file. The section that it created
in my app.config is below. I can not figure out how to access the two
settings. I need to be able to get the data out of the settings. And update
them at a later point as well. I have tried all sorts of things.
Dim CurReceipt As Integer =
CInt(ConfigurationManager.AppSettings("ReceiptNumber"))
Dim CurTrans As Int64 =
CLng(ConfigurationManager.AppSettings("TransactionNUmber"))
Each of the above lines just return 0. According to the help file, i
should be able to use My.Settings.ReceiptNumber - but that is not
available. Any ideas? Thanks
Stacey
<applicationSettings>
<GiftGards.Cards>
<setting name="ReceiptNumber" serializeAs="String">
<value>50</value>
</setting>
<setting name="TransactionNumber" serializeAs="String">
<value>1000</value>
</setting>
</GiftGards.Cards>
</applicationSettings>
-----------WARNINGS AND ERROR MESSAGES BELOW-------------
Warning 1 The 'requirePermission' attribute is not declared. D:\Projects
..NET\RTCGiftGards\RTCGiftGards\app.config 5 176 RTCGiftGards
Message 2 Could not find schema information for the element
'applicationSettings'. D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config
30 6 RTCGiftGards
Message 3 Could not find schema information for the element
'RTCGiftGards.RTCCards'. D:\Projects
..NET\RTCGiftGards\RTCGiftGards\app.config 31 10 RTCGiftGards
Message 4 Could not find schema information for the element 'setting'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 14 RTCGiftGards
Message 5 Could not find schema information for the attribute 'name'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 22 RTCGiftGards
Message 6 Could not find schema information for the attribute 'serializeAs'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 43 RTCGiftGards
Message 7 Could not find schema information for the element 'value'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 33 18 RTCGiftGards
Message 8 Could not find schema information for the element 'setting'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 14 RTCGiftGards
Message 9 Could not find schema information for the attribute 'name'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 22 RTCGiftGards
Message 10 Could not find schema information for the attribute
'serializeAs'. D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 47
RTCGiftGards
Message 11 Could not find schema information for the element 'value'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 36 18 RTCGiftGards
a settings file and two settings in the file. The section that it created
in my app.config is below. I can not figure out how to access the two
settings. I need to be able to get the data out of the settings. And update
them at a later point as well. I have tried all sorts of things.
Dim CurReceipt As Integer =
CInt(ConfigurationManager.AppSettings("ReceiptNumber"))
Dim CurTrans As Int64 =
CLng(ConfigurationManager.AppSettings("TransactionNUmber"))
Each of the above lines just return 0. According to the help file, i
should be able to use My.Settings.ReceiptNumber - but that is not
available. Any ideas? Thanks
Stacey
<applicationSettings>
<GiftGards.Cards>
<setting name="ReceiptNumber" serializeAs="String">
<value>50</value>
</setting>
<setting name="TransactionNumber" serializeAs="String">
<value>1000</value>
</setting>
</GiftGards.Cards>
</applicationSettings>
-----------WARNINGS AND ERROR MESSAGES BELOW-------------
Warning 1 The 'requirePermission' attribute is not declared. D:\Projects
..NET\RTCGiftGards\RTCGiftGards\app.config 5 176 RTCGiftGards
Message 2 Could not find schema information for the element
'applicationSettings'. D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config
30 6 RTCGiftGards
Message 3 Could not find schema information for the element
'RTCGiftGards.RTCCards'. D:\Projects
..NET\RTCGiftGards\RTCGiftGards\app.config 31 10 RTCGiftGards
Message 4 Could not find schema information for the element 'setting'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 14 RTCGiftGards
Message 5 Could not find schema information for the attribute 'name'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 22 RTCGiftGards
Message 6 Could not find schema information for the attribute 'serializeAs'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 32 43 RTCGiftGards
Message 7 Could not find schema information for the element 'value'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 33 18 RTCGiftGards
Message 8 Could not find schema information for the element 'setting'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 14 RTCGiftGards
Message 9 Could not find schema information for the attribute 'name'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 22 RTCGiftGards
Message 10 Could not find schema information for the attribute
'serializeAs'. D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 35 47
RTCGiftGards
Message 11 Could not find schema information for the element 'value'.
D:\Projects .NET\RTCGiftGards\RTCGiftGards\app.config 36 18 RTCGiftGards