System DSN and Connection STrings

Posts   
 
    
rell
User
Posts: 25
Joined: 15-Apr-2009
# Posted on: 03-Sep-2009 06:52:05   

Hi

I have been asked to start using System DSN's to connect to databases.
All the information that I have found says to use adapter when using DSN's. I have read all the articles on the forum regarding this including the connection to Access Db.

I have written code using self-servicing and this has been converted to adapter with no problems.

I have set up the DSN to access the database through the ODBC but have encountered a problem

The app.config connection string has been changed to:

<add key="Main.ConnectionString" value="DSN=Timesheet;Trusted_Connection=yes;" providerName="System.Data.Odbc" />

I now get an error saying the dsn isn't recognised.

When the LLBLGenerated code links to the database does it recognise the DSN.

What have I done wrong.

Any suggestions are welcome.

thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Sep-2009 11:16:34   

Forget about LLBLgen for a second.

<add key="Main.ConnectionString" value="DSN=Timesheet;Trusted_Connection=yes;" providerName="System.Data.Odbc" />

Can you use the above connection string to access the database from ordinary ADO.NET code?

rell
User
Posts: 25
Joined: 15-Apr-2009
# Posted on: 08-Sep-2009 03:35:22   

Thanks for your reponse. They have now changed their mind and decided to go with the standard connection string.