connection-string
Keyword not supported: “data source” initializing Entity Framework Context
The real reason you were getting this error is because of the " values in your connection string. If you replace those with single quotes then it will work fine. https://learn.microsoft.com/archive/blogs/rickandy/explicit-connection-string-for-ef (Posted so others can get the fix faster than I did.)
encrypt SQL connectionstring c#
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.
How to fix error ::Format of the initialization string does not conform to specification starting at index 0::
It might help to see what the actual connection string is. Add to Global.asax: throw new Exception(ConfigurationManager.ConnectionStrings[“mcn”].ConnectionString); If the actual connection string is $(ReplacableToken_mcn-Web.config Connection String_0), that would explain the problem.
Encrypting connectionStrings section – utility for app.config
You can try the following: https://magenic.com/thinking/encrypting-configuration-sections-in-net In short – rename the app.config file to web.config – the schema is identical, so aspnet_regiis works. Rename back to app.config when finished.
Default Schema in Oracle Connection URL
You can’t put anything in the connection URL. In Oracle each user has their own schema (even if doesn’t contain any objects) and that is their default schema. Once logged in/connected, they can change their default schema with an ALTER SESSION SET CURRENT_SCHEMA=animals So you’d need to do the extra statement after connecting. It is … Read more
What is the point of “Initial Catalog” in a SQL Server connection string?
If the user name that is in the connection string has access to more then one database you have to specify the database you want the connection string to connect to. If your user has only one database available then you are correct that it doesn’t matter. But it is good practice to put this … Read more
Connection string using Windows Authentication
Replace the username and password with Integrated Security=SSPI; So the connection string should be <connectionStrings> <add name=”NorthwindContex” connectionString=”data source=localhost; initial catalog=northwind;persist security info=True; Integrated Security=SSPI;” providerName=”System.Data.SqlClient” /> </connectionStrings>
ADODB Connection String for .csv
For a text file, Data Source is the folder, not the file. The file is the table (SELECT * FROM ..). See http://www.connectionstrings.com/textfile
Format of the initialization string does not conform to specification starting at index 0
Format of the initialization string does not conform to specification starting at index 0 Web.config : <connectionStrings> <add name=”TestDataConnectionString” connectionString=”Data Source=.\SQLExpress;Initial Catalog=TestData;User ID=satest;Password=satest” /> </connectionStrings> In aspx.cs Page the code must be written in the below format : SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[“TestDataConnectionString”].ToString());