Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
AnswerRe: serialization / type cast differs between service and console execution Pin
Mycroft Holmes26-Mar-13 15:34
professionalMycroft Holmes26-Mar-13 15:34 
GeneralRe: serialization / type cast differs between service and console execution Pin
JudyL_MD26-Mar-13 16:21
JudyL_MD26-Mar-13 16:21 
GeneralRe: serialization / type cast differs between service and console execution Pin
Mycroft Holmes26-Mar-13 16:49
professionalMycroft Holmes26-Mar-13 16:49 
GeneralRe: serialization / type cast differs between service and console execution Pin
Dave Kreskowiak26-Mar-13 17:02
mveDave Kreskowiak26-Mar-13 17:02 
GeneralRe: serialization / type cast differs between service and console execution Pin
JudyL_MD27-Mar-13 1:42
JudyL_MD27-Mar-13 1:42 
GeneralRe: serialization / type cast differs between service and console execution Pin
Dave Kreskowiak27-Mar-13 1:48
mveDave Kreskowiak27-Mar-13 1:48 
GeneralRe: serialization / type cast differs between service and console execution Pin
JudyL_MD27-Mar-13 1:52
JudyL_MD27-Mar-13 1:52 
Questiondevexpress winforms controls Pin
naseer86126-Mar-13 11:16
naseer86126-Mar-13 11:16 
AnswerRe: devexpress winforms controls Pin
Dave Kreskowiak26-Mar-13 11:43
mveDave Kreskowiak26-Mar-13 11:43 
AnswerRe: devexpress winforms controls Pin
Pete O'Hanlon26-Mar-13 12:09
mvePete O'Hanlon26-Mar-13 12:09 
AnswerRe: devexpress winforms controls Pin
NotPolitcallyCorrect26-Mar-13 14:45
NotPolitcallyCorrect26-Mar-13 14:45 
AnswerRe: devexpress winforms controls Pin
Mycroft Holmes26-Mar-13 15:29
professionalMycroft Holmes26-Mar-13 15:29 
QuestionDirectoryInfo does not return full path Pin
MumbleB26-Mar-13 9:43
MumbleB26-Mar-13 9:43 
AnswerRe: DirectoryInfo does not return full path Pin
Alan N26-Mar-13 11:18
Alan N26-Mar-13 11:18 
GeneralRe: DirectoryInfo does not return full path Pin
MumbleB2-Apr-13 9:12
MumbleB2-Apr-13 9:12 
QuestionUSB To Increase speed Pin
C-P-User-326-Mar-13 6:37
C-P-User-326-Mar-13 6:37 
QuestionRe: USB To Increase speed Pin
MicroVirus27-Mar-13 3:19
MicroVirus27-Mar-13 3:19 
QuestionType cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 3:47
ptr_Electron26-Mar-13 3:47 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
harold aptroot26-Mar-13 3:57
harold aptroot26-Mar-13 3:57 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 5:39
ptr_Electron26-Mar-13 5:39 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
PIEBALDconsult26-Mar-13 5:11
mvePIEBALDconsult26-Mar-13 5:11 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 5:40
ptr_Electron26-Mar-13 5:40 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
OriginalGriff26-Mar-13 6:38
mveOriginalGriff26-Mar-13 6:38 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
Bernhard Hiller26-Mar-13 22:29
Bernhard Hiller26-Mar-13 22:29 
QuestionHow to append connectionString from one config file to other config file Pin
NarVish26-Mar-13 1:32
NarVish26-Mar-13 1:32 
Hi,

I'm trying to copy connectionStrings from C:\test2\web.config to c:\test1\app.config. In web.config, connectionString element looks as below. both config files are not belong to my project.
XML
<connectionStrings>
    <add name="SqlServerConnectionString" connectionString="server=NAPALDEVDBS02.dev.psisystems.local\DEV08; database=VPO1; User ID={0}; Password={1}; Pooling=True; Min Pool Size=5; Max Pool Size=40; Connect Timeout=10;" providerName="System.Data.SqlClient" />
    <add name="SqlServerConnectionPropertiesString" connectionString="Initial Catalog=VPO1;Integrated Security=False;Uid=WSAccountData;Pwd=drUc5u8r;" providerName="System.Data.SqlClient" />
    <add name="VPO1" connectionString="server=NAPALDEVDBS02.dev.psisystems.local\DEV08; database=VPO1; User ID=VPOServer; Password=Mon186ster;" />
  </connectionStrings>


C#
ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();

fileMap.ExeConfigFilename = @"c:\test1\app.config";
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);

var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");

ExeConfigurationFileMap fileMapWeb = new ExeConfigurationFileMap();
fileMapWeb.ExeConfigFilename = @"C:\test2\web.config";
Configuration configWeb = ConfigurationManager.OpenMappedExeConfiguration(fileMapWeb, ConfigurationUserLevel.None);

var connectionStringsWeb = (ConnectionStringsSection)configWeb.GetSection("connectionStrings");

//here I got connectionString element in connectionStringsWeb from web.config file. But how to append this connectionString element to app.config file.


Thanks in advance.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.