Yes, windows authentication is the way to go. However, if for whatever
reasons you still want the connection string somewhere else, look at the
Enterprise Library - Data Access Application Block. There is a sample there
that shows you how to store the connection string in the app.config file
(actually it is in the dataconfiguration.config) and encrypt that section of
the configuration file.
Regards,
Eddie

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Phil Sayers
Sent: Monday, October 02, 2006 9:10 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] SQL connection information - Encryption


keep the database server name only in the config file.
..optionally keep the database name in the config fie.

use windows integrated authentication to connect to the sql server.  with
the sql account options, you can set a default database...or make sure you
use 4 part naming to explicitly specify which database your sql code is
using...

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Hevel, Shawn
Sent: Monday, October 02, 2006 9:01 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] SQL connection information - Encryption


I have a class that needs to connect to a SQL Server Database.  How can I
encrypt my connection information without hard-coding the connection string
in the class?  I thought about using the App.Config file but I don't think
that is allowed because the class is not in an executable project?  Is that
correct statement?



What would be the best way to hide this connection information using
encryption?



Thanks for the help.



Shawn Hevel, API, AIT
Lead Programmer Analyst
Information Technology Department
South Carolina Farm Bureau Insurance Companies
Phone: (803) 936-4331
Fax: (803) 936-4629
Work Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Home Email: [EMAIL PROTECTED]




===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to