|
-
May 11th, 2005, 08:55 PM
#1
Thread Starter
PowerPoster
Where to set ConfigurationSettings.AppSettings? [Resolved]
Where can I set the ConnectionString that is referred to in this line of code?
VB Code:
Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Here is original link with full code:
http://authors.aspalliance.com/das/insertimage.html
From this article:
http://aspalliance.com/articleViewer.aspx?aId=138&pId=
Thanks!
Last edited by Dave Sell; May 11th, 2005 at 09:55 PM.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
May 11th, 2005, 09:27 PM
#2
Re: Where to set ConfigurationSettings.AppSettings?
Dave, ConfigurationSettings sounds like its the name of the project and AppSettings is the name of a class? Its probably grabbing
the ConnectionString property from that class. I noticed that the article refers to it on other examples too but without
definition. You could probably re-create it if you cant find it on thir site.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 11th, 2005, 09:28 PM
#3
Re: Where to set ConfigurationSettings.AppSettings?
-
May 11th, 2005, 09:29 PM
#4
Thread Starter
PowerPoster
Re: Where to set ConfigurationSettings.AppSettings?
I don't have a .CONFIG file. Its a stand-alone .ASPX file.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
May 11th, 2005, 09:30 PM
#5
Re: Where to set ConfigurationSettings.AppSettings?
web.config, to be specific.
Code:
<configuration>
<appSettings>
<add key="ConnectionString"
value="sdlfkjaslfkjasdlfkjasdlfkjasdflk" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
-
May 11th, 2005, 09:31 PM
#6
Thread Starter
PowerPoster
Re: Where to set ConfigurationSettings.AppSettings?
How can I associate a .CONFIG file to this stand-alone .aspx file? When I open the .aspx file in vis stud, it doesn't make a Solution or Project. There is just the file... Any pointers greatly appreciated.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
May 11th, 2005, 09:31 PM
#7
Re: Where to set ConfigurationSettings.AppSettings?
 Originally Posted by Dave Sell
I don't have a .CONFIG file. Its a stand-alone .ASPX file.
Then you might as well store your connection string in a variable and forget about configurationsettings.
-
May 11th, 2005, 09:32 PM
#8
Re: Where to set ConfigurationSettings.AppSettings?
We're talking out of sync 
Create a new web project and add the aspx file to the solution.
Or just copy over the aspx and code to the existing .aspx in the new solution.
-
May 11th, 2005, 09:33 PM
#9
Re: Where to set ConfigurationSettings.AppSettings?
Just make sure the page directive isn't copied over.
-
May 11th, 2005, 09:55 PM
#10
Thread Starter
PowerPoster
Re: Where to set ConfigurationSettings.AppSettings?
Mendhak's advice was right-on. kudos! Thanks all!
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|