I\'m having a trouble with the \'
character in a connection string. Entity Framework throws an exception saying:
Format of the initializ
Assuming it is the password which contains a single quote, you should try enclosing the password in xml encoded double-quotes, something like this :
Assuming you are not in Xml context (as mentionned by @PanagiotisKanavos ) the ConnectionString initialization would look like :
var conn = new SqlConnection("Data Source=.;
Initial Catalog=MYDB; User ID=MyUser;Password=\"my'password\";
providerName="System.Data.SqlClient")