Click here to Skip to main content
15,915,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Browse all controls Pin
Judah Gabriel Himango2-Dec-04 5:37
sponsorJudah Gabriel Himango2-Dec-04 5:37 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 7:30
protectorHeath Stewart2-Dec-04 7:30 
GeneralRe: Browse all controls Pin
turbochimp2-Dec-04 5:08
turbochimp2-Dec-04 5:08 
GeneralProblem with string literals Pin
pchak2-Dec-04 4:18
pchak2-Dec-04 4:18 
GeneralRe: Problem with string literals Pin
turbochimp2-Dec-04 4:50
turbochimp2-Dec-04 4:50 
GeneralRe: Problem with string literals Pin
pchak2-Dec-04 5:30
pchak2-Dec-04 5:30 
Generalconnection path for database Pin
steve_rm2-Dec-04 4:18
steve_rm2-Dec-04 4:18 
GeneralRe: connection path for database Pin
turbochimp2-Dec-04 4:35
turbochimp2-Dec-04 4:35 
You could create a config (app.config or web.config depending on your project type) file for your application and expose the connection information there as separate variables (e.g. Provider, Data Source, Persist Security Info etc.) See the System.Configuration namespace for information about accessing the contents of config files (or check out the CMAB [Configuration Management Application Block] provided by MS).

This approach is favorable to hard coding the connection information for a number of reasons:

1. You, the developer, are free to change your database platform easily in your development environment.
2. Users of your application can place their datastore where they choose.
3. Changes may be made at any time, and will take effect immediately, and without requiring a recompile.
4. You can encrypt the authentication info in a config file if necessary.

Note: You may also want to include parameters for accessing secured Access databases. Even if you don't lock down the DB currently, you may want to in the future.

Alternate choices to using a config file include using the registry, or a text file.


The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

GeneralRe: connection path for database Pin
steve_rm2-Dec-04 5:20
steve_rm2-Dec-04 5:20 
Generalusing a TextBox without focus Pin
jjansen2-Dec-04 4:14
jjansen2-Dec-04 4:14 
GeneralC# compact framework Yes/No MessageBox Pin
DanielFP2-Dec-04 3:50
DanielFP2-Dec-04 3:50 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Dave Kreskowiak2-Dec-04 5:42
mveDave Kreskowiak2-Dec-04 5:42 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Daniel P2-Dec-04 6:55
Daniel P2-Dec-04 6:55 
Generalfilling RichTextBox using MemoryStream Pin
Hovik Melkomian2-Dec-04 3:50
Hovik Melkomian2-Dec-04 3:50 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie2-Dec-04 4:47
leppie2-Dec-04 4:47 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian4-Dec-04 1:55
Hovik Melkomian4-Dec-04 1:55 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie4-Dec-04 2:23
leppie4-Dec-04 2:23 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian4-Dec-04 2:40
Hovik Melkomian4-Dec-04 2:40 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie4-Dec-04 3:33
leppie4-Dec-04 3:33 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian6-Dec-04 1:42
Hovik Melkomian6-Dec-04 1:42 
Generallibraries, DLL's, Wrappers Pin
Mridang Agarwalla2-Dec-04 2:50
Mridang Agarwalla2-Dec-04 2:50 
GeneralRe: libraries, DLL's, Wrappers Pin
turbochimp2-Dec-04 3:45
turbochimp2-Dec-04 3:45 
Generalviewing multiple image formats Pin
Mridang Agarwalla2-Dec-04 2:46
Mridang Agarwalla2-Dec-04 2:46 
Generalcontrols inside a datagrid Pin
Mridang Agarwalla2-Dec-04 1:36
Mridang Agarwalla2-Dec-04 1:36 
GeneralRe: controls inside a datagrid Pin
turbochimp2-Dec-04 2:46
turbochimp2-Dec-04 2:46 

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.