Click here to Skip to main content
15,123,509 members
Home / Discussions / C#
   

C#

 
QuestionType cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 4:47
Memberptr_Electron26-Mar-13 4:47 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
harold aptroot26-Mar-13 4:57
Memberharold aptroot26-Mar-13 4:57 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 6:39
Memberptr_Electron26-Mar-13 6:39 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
PIEBALDconsult26-Mar-13 6:11
professionalPIEBALDconsult26-Mar-13 6:11 
GeneralRe: Type cast a enum to different enum type in the entire List; C# Pin
ptr_Electron26-Mar-13 6:40
Memberptr_Electron26-Mar-13 6:40 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
OriginalGriff26-Mar-13 7:38
mveOriginalGriff26-Mar-13 7:38 
AnswerRe: Type cast a enum to different enum type in the entire List; C# Pin
Bernhard Hiller26-Mar-13 23:29
MemberBernhard Hiller26-Mar-13 23:29 
QuestionHow to append connectionString from one config file to other config file Pin
NarVish26-Mar-13 2:32
MemberNarVish26-Mar-13 2: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.
QuestionOverflow, carry, etc i C# Pin
hanzibal226-Mar-13 1:00
Memberhanzibal226-Mar-13 1:00 
AnswerRe: Overflow, carry, etc i C# Pin
Richard MacCutchan26-Mar-13 1:08
mveRichard MacCutchan26-Mar-13 1:08 
GeneralRe: Overflow, carry, etc i C# Pin
Jonathan Nethercott26-Mar-13 1:40
professionalJonathan Nethercott26-Mar-13 1:40 
GeneralRe: Overflow, carry, etc i C# Pin
Richard MacCutchan26-Mar-13 2:03
mveRichard MacCutchan26-Mar-13 2:03 
GeneralRe: Overflow, carry, etc i C# Pin
hanzibal226-Mar-13 3:01
Memberhanzibal226-Mar-13 3:01 
GeneralRe: Overflow, carry, etc i C# Pin
Richard MacCutchan26-Mar-13 3:10
mveRichard MacCutchan26-Mar-13 3:10 
AnswerRe: Overflow, carry, etc i C# Pin
parths26-Mar-13 22:20
Memberparths26-Mar-13 22:20 
GeneralRe: Overflow, carry, etc i C# Pin
hanzibal226-Mar-13 23:56
Memberhanzibal226-Mar-13 23:56 
GeneralRe: Overflow, carry, etc i C# Pin
harold aptroot27-Mar-13 0:08
Memberharold aptroot27-Mar-13 0:08 
QuestionFile.Move/create just won't work! Pin
Goaty6510925-Mar-13 12:28
MemberGoaty6510925-Mar-13 12:28 
AnswerRe: File.Move/create just won't work! Pin
DaveyM6925-Mar-13 12:58
professionalDaveyM6925-Mar-13 12:58 
AnswerRe: File.Move/create just won't work! Pin
Abhinav S25-Mar-13 17:47
MemberAbhinav S25-Mar-13 17:47 
AnswerRe: File.Move/create just won't work! Pin
Richard MacCutchan26-Mar-13 1:02
mveRichard MacCutchan26-Mar-13 1:02 
GeneralRe: File.Move/create just won't work! Pin
Goaty6510926-Mar-13 4:16
MemberGoaty6510926-Mar-13 4:16 
GeneralRe: File.Move/create just won't work! Pin
Richard MacCutchan26-Mar-13 7:37
mveRichard MacCutchan26-Mar-13 7:37 
GeneralRe: File.Move/create just won't work! Pin
Goaty6510926-Mar-13 9:51
MemberGoaty6510926-Mar-13 9:51 
GeneralRe: File.Move/create just won't work! Pin
Richard MacCutchan26-Mar-13 10:14
mveRichard MacCutchan26-Mar-13 10:14 

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.