You should store your connection string in a config file and encrypt that section. See https://web.archive.org/web/20211020203213/https://www.4guysfromrolla.com/articles/021506-1.aspx or http://msdn.microsoft.com/en-us/library/89211k9b%28VS.80%29.aspx.
More Related Contents:
- SQL Express connection string: mdf file location relative to application location
- Automated checking of database connection and query in same database [closed]
- Execute non-query error [closed]
- Encrypt and decrypt a string in C#? [closed]
- Entity Framework change connection at runtime
- Get connection string from App.config
- Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework
- Wildcard search for LINQ
- Map category parent id self referencing table structure to EF Core entity
- Get an IDataReader from a typed List
- Does using parameterized SqlCommand make my program immune to SQL injection?
- Entity Framework – stored procedure return value
- What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)
- Direct method from SQL command text to DataSet
- Problem Updating to .Net 6 – Encrypting String
- Table name and table field on SqlParameter C#?
- ExecuteNonQuery returning -1 when using sql COUNT despite the query string
- How to make LINQ execute a (SQL) LIKE range search
- Encrypting Web.Config
- Sql Bulk Copy/Insert in C#
- Calling SQL Defined function in C#
- Checking for empty or null JToken in a JObject
- How do I use Web.Config transform on my connection strings?
- SQL/C# – Best method for executing a query
- AES Encryption in Java and Decryption in C#
- Index (zero based) must be greater than or equal to zero
- Issues Doing a String Comparison in LINQ
- C# SQL insert command
- How do I extract data from a DataTable?
- Persist Security Info Property=true and Persist Security Info Property=false