|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
How do I create one connection string for firebird in VS 2005 so that I would not have to type everytime I want to connect to the database. I am creating a windows application using Visual Studio 2005. The language that I am using is C#. Please help and advice. Please give out examples as well on how or where do I do this one connection string so that I do not need to write a connection string in every window forms that I created. Thanks in advance. ![]() |
|
#2
|
|||
|
|||
|
I already got the solution.
Here is the solution for everyone. Add a App.config file (*.config) Type for example:- Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DB_CONN_STRING"
value="User=SYSDBA;Password=masterkey;Database=C:\\MYPROJECT\\DATABASE\\MYDB.FDB"/>
</appSettings>
</configuration>
Then add reference --> System.Configuration Then within your windows form do this on top... at the beginning (i guess) Code:
string strConnectionString = System.Configuration.ConfigurationManager.AppSettings["DB_CONN_STRING"]; done! To use it just like this:- Code:
FbConnection c = new FbConnection(strConnectionString); |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Create one connection string for firebird in VS 2005 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|