ConnectionStringBuilder

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

Hello.
1. Is there any wizard for connectionStringBuilder for each provider (wizard
for oracle, wizard for sqlserver ...)?
2. Specifically SqlConnectionStringBuilder has keys that are for the
connectionStrings :
If I search all the keys :
SqlConnectionStringBuilder csbSqlConn = new
SqlConnectionStringBuilder();
foreach (string e in csbSqlConn.keys)
{
MessageBox.Show(e.ToString());
}

I get lot of keys (the message).
Do I need all of the keys in order to build the connectionString?
If not - how can I find only the necessary keys for building the
connectionString?

Thanks :)
 
1. Is there any wizard for connectionStringBuilder for each provider
(wizard for oracle, wizard for sqlserver ...)?
2. Specifically SqlConnectionStringBuilder has keys that are for the
connectionStrings :
If I search all the keys :
SqlConnectionStringBuilder csbSqlConn = new
SqlConnectionStringBuilder();
foreach (string e in csbSqlConn.keys)
{
MessageBox.Show(e.ToString());
}

I get lot of keys (the message).
Do I need all of the keys in order to build the connectionString?
If not - how can I find only the necessary keys for building the
connectionString?

Are you trying to provide some sort of interface for your users to define
connection strings at run-time?
 
1. Is there any wizard for connectionStringBuilder for each provider
(wizard for oracle, wizard for sqlserver ...)?
2. Specifically SqlConnectionStringBuilder has keys that are for the
connectionStrings :
If I search all the keys :
SqlConnectionStringBuilder csbSqlConn = new SqlConnectionStringBuilder();
foreach (string e in csbSqlConn.keys)
{
MessageBox.Show(e.ToString());
}

I get lot of keys (the message).
Do I need all of the keys in order to build the connectionString?
If not - how can I find only the necessary keys for building the
connectionString?

You don't use the connection string builder.

You just add the necessary connection string in your config file.

The connection string should only contain what you need.

Usually developers know the proper connection string for
databases they work with.

But if not then look at:
http://www.connectionstrings.com/

Arne
 
I have tried :SqlConnectionStringBuilder,
OleDbConnectionStringBuilder,OdbcConnectionStringBuilder,MySqlConnectionStringBuilder

MySqlConnectionStringBuilder is the only DbConnectionStringBuilder, which
the Keys.count = 0.
Any reason for that?

Thanks :)
 
I have tried :SqlConnectionStringBuilder,
OleDbConnectionStringBuilder,OdbcConnectionStringBuilder,MySqlConnectionStringBuilder



MySqlConnectionStringBuilder is the only DbConnectionStringBuilder,
which the Keys.count = 0.
Any reason for that?

Apparently Microsoft fill in some keys at creation while
MySQL does not.

Different companies - different code.

Arne
 
Where is OracleStringBuilder ?

OracleConnectionStringBuilder

System.Data.OracleClient for the MS Oracle ADO.NET provider.

Oracle.DataAccess.Client for Oracles own ADO.NET provider.

Arne
 
OracleConnectionStringBuilder

System.Data.OracleClient for the MS Oracle ADO.NET provider.

Oracle.DataAccess.Client for Oracles own ADO.NET provider.

And unless you are providing a GUI that needs to prompt
end users for information necessary to construct a connection
string, then you will never use those builder classes.

Arne
 
Well: I succeed installing driver for : Oracle.DataAccess.Client
(Site : http://www.oracle.com/technology/software/tech/dotnet/utilsoft.html,
file : ODTwithODAC1110720.zip)
I ran the setup.

After adding reference to Oracle.DataAccess, things work fine,
but when just adding the line :
using Oracle.DataAccess.Client,
and the following line :
OracleConnectionStringBuilder csbOracle;

There is excpetion (Why?) :
Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20,
Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its
dependencies. The system cannot find the file specified.

Thanks :)
 
Well: I succeed installing driver for : Oracle.DataAccess.Client
(Site :
http://www.oracle.com/technology/software/tech/dotnet/utilsoft.html,
file : ODTwithODAC1110720.zip)
I ran the setup.

After adding reference to Oracle.DataAccess, things work fine,
but when just adding the line :
using Oracle.DataAccess.Client,
and the following line :
OracleConnectionStringBuilder csbOracle;

There is excpetion (Why?) :
Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20,
Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its
dependencies. The system cannot find the file specified.

Try copy the file Oracle.DataAccess.dll to the same dir as
your EXE.

Arne
 
On : project -> properties,
I see that on build+output path and on debug working directory,
the folders are the same, and also same as the Oracle.DataAccess.dll.
Also I saw that on references, the Oracle.DataAccess.dll is the same as my
exe file.
Maybe the reference to the site of oracle I gave first, is not good.

Thanks :)
 
Back
Top