Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
AnswerRe: IT Help desk Pin
AndieDu30-Sep-09 17:42
AndieDu30-Sep-09 17:42 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:03
mirianakoi6-Oct-09 17:03 
AnswerRe: IT Help desk Pin
Blikkies30-Sep-09 19:52
professionalBlikkies30-Sep-09 19:52 
GeneralRe: IT Help desk Pin
Mycroft Holmes30-Sep-09 23:01
professionalMycroft Holmes30-Sep-09 23:01 
GeneralRe: IT Help desk Pin
Blikkies1-Oct-09 4:06
professionalBlikkies1-Oct-09 4:06 
GeneralRe: IT Help desk Pin
Mycroft Holmes1-Oct-09 12:25
professionalMycroft Holmes1-Oct-09 12:25 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:05
mirianakoi6-Oct-09 17:05 
QuestionProject_1.exe.config and Project_2.dll.config Pin
AndieDu30-Sep-09 16:44
AndieDu30-Sep-09 16:44 
Dear All,

I've written a program that contain 2 parts, I have a UI project (Project_1), which is a WinForm, and dll project (Project_2), which handles the db access. Now in my dll project, I had DbConnectionString settings and it automatically added into app.config (dll project) file. There is another app.config file in UI project.

When I deploy my application into a test machine, I tried to change the DbConnectionString in both Project_1.exe.config and Project_2.dll.config, but the applicatiion doesn't connect to the test database, rather it connects to the database when I was used during developing stage, which is setting that I had in Properties.Settings.settings of the dll project.

Now what I really need is that I would like the application connects to any database that i specified in the DbConnectionString either in Project_1.exe.config or Project_2.dll.config. I am using OleDbConnection object.

Here is the code to get the DbConnectionString: OleDbConnection conn = new OleDbConnection(Properties.Settings.Default.DBConnectionString);

Here is the config file for dll project:
<configuration><configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CodistriCore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<CodistriCore.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Clients\Codistri\CoRE.mdb</value>
</setting>
</CodistriCore.Properties.Settings>
</applicationSettings>
</configuration>

Here is the config file for WinForm project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Codistri.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings />
<applicationSettings>
<Codistri.Properties.Settings>
<setting name="AttachmentRootFolder" serializeAs="String">
<value>S:\Clients\Codistri\Attachments</value>
</setting>
<setting name="DBConnectionString" serializeAs="String">
<value>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=S:\Clients\Codistri\CoRE.mdb</value>
</setting>
</Codistri.Properties.Settings>
</applicationSettings>
</configuration>



Any help will be much appreciated.


Andie
AnswerRe: Project_1.exe.config and Project_2.dll.config Pin
Calla30-Sep-09 21:01
Calla30-Sep-09 21:01 
GeneralRe: Project_1.exe.config and Project_2.dll.config Pin
AndieDu1-Oct-09 13:43
AndieDu1-Oct-09 13:43 
AnswerRe: Project_1.exe.config and Project_2.dll.config Pin
AndieDu1-Oct-09 16:38
AndieDu1-Oct-09 16:38 
GeneralRe: Project_1.exe.config and Project_2.dll.config Pin
Calla1-Oct-09 20:14
Calla1-Oct-09 20:14 
Questionhow to display a string on website through windows form Pin
Barkha Shreri30-Sep-09 11:23
Barkha Shreri30-Sep-09 11:23 
AnswerRe: how to display a string on website through windows form Pin
Abhishek Sur30-Sep-09 12:06
professionalAbhishek Sur30-Sep-09 12:06 
AnswerRe: how to display a string on website through windows form Pin
Tamer Oz30-Sep-09 19:23
Tamer Oz30-Sep-09 19:23 
GeneralRe: how to display a string on website through windows form Pin
Barkha Shreri1-Oct-09 1:38
Barkha Shreri1-Oct-09 1:38 
GeneralRe: how to display a string on website through windows form Pin
Barkha Shreri1-Oct-09 3:15
Barkha Shreri1-Oct-09 3:15 
QuestionC#: Need help deleting new button instances that i've create in my program! Please Help! Pin
jyjt_code30-Sep-09 10:14
jyjt_code30-Sep-09 10:14 
AnswerRe: C#: Need help deleting new button instances that i've create in my program! Please Help! Pin
Christian Graus30-Sep-09 11:13
protectorChristian Graus30-Sep-09 11:13 
GeneralRe: C#: Need help deleting new button instances that i've create in my program! Please Help! Pin
jyjt_code30-Sep-09 16:35
jyjt_code30-Sep-09 16:35 
GeneralRe: C#: Need help deleting new button instances that i've create in my program! Please Help! Pin
Christian Graus30-Sep-09 16:39
protectorChristian Graus30-Sep-09 16:39 
QuestionButton navigate Pin
Texas38930-Sep-09 9:10
Texas38930-Sep-09 9:10 
AnswerRe: Button navigate [modified] Pin
Ian Shlasko30-Sep-09 9:23
Ian Shlasko30-Sep-09 9:23 
GeneralRe: Button navigate Pin
Texas38930-Sep-09 11:10
Texas38930-Sep-09 11:10 
QuestionProblem executing a named pipe service Pin
AndyASPVB30-Sep-09 8:55
AndyASPVB30-Sep-09 8:55 

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.