Connection Strings to databases
Connection Strings to databases
I have been reading around on this. I have to do work on someone elses able install. I have downloaded the db to my machine. I am trying to change the connection string to it via the admin panel. The connection string is legitimate, other apps can hit the db. Able can not. I tried to change the string, i tried to de crypt it, but that does not work. When you just decrypt it, the save fails on the following line.
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
The app path variable is wrong.
So how do i get around this?
I want to just change out the strings in the config file, but those had to be encrypted.
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
The app path variable is wrong.
So how do i get around this?
I want to just change out the strings in the config file, but those had to be encrypted.
Steve Portock
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Re: Connection Strings to databases
On my dev system, I just wrote the App_Data\database.config file in plain text:
Code: Select all
<connectionStrings>
<add name="AbleCommerce"
connectionString="Server=dbserver(,port); Database=dbname; Uid=dbuser; Pwd=dbpassword;"
providerName="System.Data.SqlClient" />
</connectionStrings>
Nick Cole
http://www.ethofy.com
http://www.ethofy.com
Re: Connection Strings to databases
Thanks i will try that. I am running into an issue with paths to the .mdf file, the xml config files dont like that stuff, even single or double slashing it is not working.
Steve Portock
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Re: Connection Strings to databases
Are you talking about pointing the database connection string directly to the MDF file? I'm unclear about your mentioning the MDF file paths and xml config files.Harley wrote:Thanks i will try that. I am running into an issue with paths to the .mdf file, the xml config files dont like that stuff, even single or double slashing it is not working.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Connection Strings to databases
I got this to work, i fixed the path stuff. It would be nice do have documentation on what the connection string stuff looks like unencrypted. When you try to change the encryption on your local machine, it errors out on a path variable during the save.
Steve Portock
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Re: Connection Strings to databases
connectionstrings.com is a pretty good reference.Harley wrote:It would be nice do have documentation on what the connection string stuff looks like unencrypted.
Last edited by afm on Mon Jul 21, 2008 9:40 am, edited 1 time in total.
Re: Connection Strings to databases
Thanks, I know what they are supposed to look like, what I would like to see is how they look in the app. The one posted above would not have been what i would have guessed. I use the standard ones you see off sites like connectionstring.com. With it encrypted, how would anyone know what its called, stuff like that etc...
Steve Portock
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Re: Connection Strings to databases
That's the whole point to encrypting the connection string. It adds another layer of security should the web server itself ever become compromised.Harley wrote:...With it encrypted, how would anyone know what its called, stuff like that etc...
There is no connection string "in the app". Doing so would expose it to others who can access the page source files. There is a configuration page in the Security menu of the admin side that allows you to change the connection string and de-crypt it if necessary. This page is secured by IIS security and only allows site super-user accounts to access it.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Connection Strings to databases
I realize all that, but as a developer working on this, there are some problems I am encountering. One is that when you go thru the admin pages as you are running this locally, you cant change that encryption thing, it errors out on the save. Since I dont have all the source files, I have to try to figure out what is going on off what I have. Some of this is not that obvious here. I like to be able to go direct on things if I have to.
Steve Portock
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Lead Developer
Web 2 Market, Inc.
http://www.web2market.com
Mailto: sportock@web2market.com
p. 480-220-4121
f. 877-245-5553
Re: Connection Strings to databases
I just tried on a local machine and I was able to switch from encrypted to plain text and back using the AC admin page. Sounds like you found a bug. You can report bugs in the CRM.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Connection Strings to databases
Here is what an unencrypted connection string looks like in an AC7 site on a shared hoster where it can't be encrypted because of file permissions. It is in the App_Data/database.config file and I think that is where it gets changed if you try from the admin.
<connectionStrings>
<add name="AbleCommerce" connectionString="Server=severname;Database=dbname;Uid=whatever;Pwd=secret;" providerName="System.Data.SqlClient" />
</connectionStrings>
<connectionStrings>
<add name="AbleCommerce" connectionString="Server=severname;Database=dbname;Uid=whatever;Pwd=secret;" providerName="System.Data.SqlClient" />
</connectionStrings>
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx