![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I am writing a Web install project and I want to get the connection string from user and write it in the web.config of the installed web site. As the Websetup is a windows program, I use a windows program to get the string and I don't know if I can use the WebConfigurationManager API to read and write my web config from a windows program. What is the prefered .NET 2 way to handle this necessary install problem without asking users to open web.config and write the connection stri ng in the ConnectionString section by hand.. Thanks for help CS |
#3
| |||
| |||
|
|
If you put it into web.config, that will immediately restart asp.net. I would not recommend doing this. If the user is going to change this on the fly, I would create a separate file, and write to it. Just make sure that it is secured such that someone can't create an http request and ask for it. I think maybe .config files are protected automatically, so maybe you can call it myConnString.config, and have IIS take care of this for you (double check this). "WT" <WT (AT) newsgroups (DOT) nospam> wrote in message news:%23h1vrx$gGHA.2188 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Hello, I am writing a Web install project and I want to get the connection string from user and write it in the web.config of the installed web site. As the Websetup is a windows program, I use a windows program to get the string and I don't know if I can use the WebConfigurationManager API to read and write my web config from a windows program. What is the prefered .NET 2 way to handle this necessary install problem without asking users to open web.config and write the connection stri ng in the ConnectionString section by hand.. Thanks for help CS |
#4
| |||
| |||
|
|
Thanks for answer but you have not understood my problem, may be badly explained, my fault. I am installing a web site using a web setup program built with VS2005. Nothing is running, the setup process has just copied the files in the desired server folder, and the GetLicence Dialog is ran to get the SQL connection string from user. CS "Marina Levit [MVP]" <someone (AT) nospam (DOT) com> a écrit dans le message de news: eti9AAAhGHA.1324 (AT) TK2MSFTNGP04 (DOT) phx.gbl... If you put it into web.config, that will immediately restart asp.net. I would not recommend doing this. If the user is going to change this on the fly, I would create a separate file, and write to it. Just make sure that it is secured such that someone can't create an http request and ask for it. I think maybe .config files are protected automatically, so maybe you can call it myConnString.config, and have IIS take care of this for you (double check this). "WT" <WT (AT) newsgroups (DOT) nospam> wrote in message news:%23h1vrx$gGHA.2188 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Hello, I am writing a Web install project and I want to get the connection string from user and write it in the web.config of the installed web site. As the Websetup is a windows program, I use a windows program to get the string and I don't know if I can use the WebConfigurationManager API to read and write my web config from a windows program. What is the prefered .NET 2 way to handle this necessary install problem without asking users to open web.config and write the connection stri ng in the ConnectionString section by hand.. Thanks for help CS |
#5
| |||
| |||
|
|
I am writing a Web install project and I want to get the connection string from user and write it in the web.config Why? |
|
Hello, I am writing a Web install project and I want to get the connection string from user and write it in the web.config of the installed web site. As the Websetup is a windows program, I use a windows program to get the string and I don't know if I can use the WebConfigurationManager API to read and write my web config from a windows program. What is the prefered .NET 2 way to handle this necessary install problem without asking users to open web.config and write the connection stri ng in the ConnectionString section by hand.. Thanks for help CS |
#6
| |||
| |||
|
|
I am writing a Web install project and I want to get the connection string from user and write it in the web.config Why? Relative folder is allowed nativly. |
#7
| |||
| |||
|
|
What do you call relative folder ? Sometime several SQL servers are available, and different connection strings. CS "Edwin Knoppert" <info (AT) pbsoft (DOT) speedlinq.nl> a écrit dans le message de news: e5i12i$50t$1 (AT) azure (DOT) qinip.net... I am writing a Web install project and I want to get the connection string from user and write it in the web.config Why? Relative folder is allowed nativly. |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Hi, Thank you for your post! Although in .NET 2.0 we can use WebConfigurationManager API to read/write the web.config via code, currently WebConfigurationManager.OpenWebConfiguration() can only use virtual path to access web.config. Since you are running a Windows application, I'm afraid this approach will not be applicable. Regards, Walter Wang Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |