Well sir i m afraid you have to do this way simply because u ve inserted 2
keys with similar name so .NET will return the fiirst value it will find.
Other wise you have to provide name. Otherwise bydefault it will always take
the Dev string.
"stephen" wrote:
Quote:
Hi,
>
I have Question on DAAB.
I created 2 connection parameters one for Development box and another For
Test box, when I tried to access them using this piece of code, I get an
error
>
Here's what I did:
in the dataConfiguration.config:
<instances>
<instance name="Database Instance" type="Sql Server"
connectionString="Development" />
<instance name="Database Instance" type="Sql Server"
connectionString="Test" />
</instances>
<connectionStrings>
<connectionString name="Development">
<parameters>
---Some parameters here---
</parameters>
</connectionString>
<connectionString name="Test">
<parameters>
---Some parameters here---
</parameters>
</connectionString>
</connectionStrings>
>
In the Code:
I tried this
Dim ds As DataSet =
DatabaseFactory.CreateDatabase("Development").Exec uteDataSet(CommandType.Text,
_
"SELECT * FROM Categories ORDER BY CategoryName")
>
It gave me an error....
>
>
but when I changed it to this
Dim ds As DataSet =
DatabaseFactory.CreateDatabase().ExecuteDataSet(Co mmandType.Text, _
"SELECT * FROM Categories ORDER BY CategoryName")
>
it worked fine...
I understand it takes the default value from the dataConfiguration.config
file but everytime i switch from Dev to Test i have to change the
connectionString in instance name to point appropriately...
>
can you please tell me how to avoid this?
>
>
Thanks,
Stephen
>
>
>