connection-string

Format of the initialization string does not conform to specification starting at index 0

人盡茶涼 提交于 2019-11-27 02:08:15
I have an ASP.Net MVC application which runs fine on my local development machine. But when deployed to IIS7 gives the following error when trying to log in: Format of the initialization string does not conform to specification starting at index 0 Most people who post this error resolve it by changing their connection string in some way. However my connection string on the local and deployed application are the same. The connection string is like this: <add name="ApplicationServices" connectionString="Data Source=*server*\*instance*;Initial Catalog=*database*;Integrated Security=True;"

Centralize connection strings for multiple projects within the same solution

◇◆丶佛笑我妖孽 提交于 2019-11-27 01:59:33
问题 I currently have three projects in my solution that all have their own App.config file with the same exact connection string. Is there a way to consolidate the connections strings / app.config files so that I only need to make changes to one location? 回答1: There's a few ways you could do it: Put common configuration settings in machine.config as shown here Put common configuration settings in a central file and link to that in each projects's app.config as shown here Store the configuration

How to get database url from java.sql.Connection?

本小妞迷上赌 提交于 2019-11-27 01:12:29
问题 For given Connection instance how do I find out url that the Connection uses to connect the database ? Is it somewhere in Properties returned by Connection.getClientInfo() method? If there you need me to provide clearer description all comments are welcome. Thank you 回答1: Connection has the getMetaData() to return DatabaseMetaData . DatabaseMetaData has the getURL() to return the URL for this DBMS. 回答2: I believe you can use the DatabaseMetaData object from the Connection and then get the URL

Login failed for user 'NT AUTHORITY\\NETWORK SERVICE'

眉间皱痕 提交于 2019-11-27 01:07:47
I been strugling with this for 2 days now without comming any closer to solution. I have read 20-30 threads alteast and stil can not resolve this. Please help me out. I have disable anonymous authentication, enable asp.net impersonation. I have added <identity impersonate = "true" /> I have added the a user to the security logins that is connected to the database I try to connect to This is the connectionstring I use: Data Source=IPTOSERVER;Initial Catalog=Phaeton;User Id=User;Password=Password; errormessage: Cannot open database "Phaeton.mdf" requested by the login. The login failed. Login

keyword not supported data source

走远了吗. 提交于 2019-11-27 00:08:13
I have an asp.net-mvc application with the default membership database. I am accessing it by ADO.NET Entity Framework. Now I want to move it to IIS, but several problems showed up. I had to install SQL Server Management Studio, Create new DB, import there all the data from the previous .MDF file. Only thing left to do (as far a I know) is to change to connection string. However, I am not really experienced with this and keep getting the Keyword not supported: 'data source'. exception. Here is my connection string: <add name="ASPNETDBEntities" connectionString="Data Source=MONTGOMERY-DEV

How to check if connection string is valid?

老子叫甜甜 提交于 2019-11-27 00:07:44
I'm writing an application where a user provides a connection string manually and I'm wondering if there is any way that I could validate the connection string - I mean check if it's correct and if the database exists. You could try to connect? For quick (offline) validation, perhaps use DbConnectionStringBuilder to parse it... DbConnectionStringBuilder csb = new DbConnectionStringBuilder(); csb.ConnectionString = "rubb ish"; // throws But to check whether the db exists, you'll need to try to connect. Simplest if you know the provider, of course: using(SqlConnection conn = new SqlConnection(cs

Difference Between Persist Security Info And Integrated Security?

家住魔仙堡 提交于 2019-11-26 23:02:51
问题 In a SQL Server connection string, what's the difference between Integrated Security = True/SSPI and Persist Security = True ? 回答1: Persist Security = true means that the Password used for SQL authentication is not removed from the ConnectionString property of the connection. When Integrated Security = true is used then the Persist Security is completely irelevant since it only applies to SQL authentication, not to windows/Integrated/SSPI. 回答2: " Integrated Security " or "Trusted_Connection"

How do I use Web.Config transform on my connection strings?

不羁的心 提交于 2019-11-26 22:38:42
In my current project, I have some connection strings that are valid for local development machines: <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI" </connectionStrings> .... </configuration> How would I use the Web.Config transforms to convert from this expression to one valid for our production server? The production server one would look something like: <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="Data Source=IPAddress,Port;Initial Catalog

System.Data.SqlClient.SqlException: Login failed for user

蓝咒 提交于 2019-11-26 22:23:45
问题 Working with my project in debug I have no issues. However running it in IIS I am getting this error: System.Data.SqlClient.SqlException: Login failed for user 'domain\name-PC$'. Stack Trace [SqlException (0x80131904): Login failed for user 'CAPLUGSLLC\OETINGER-PC$'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6749670 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,

Storing connection strings in machine.config vs storing them in web.config

天涯浪子 提交于 2019-11-26 21:37:18
问题 For a dedicated server, is it better to store the connection string in web.config or machine.config? what's the advantages and disadvantages of each approach? Thanks Edit: I'm concerned about security here, so, the question is about which approach is more secure. 回答1: I would always go with web.config on the grounds that that is where everyone would expect it to be. There is no point in giving the person that has to maintain the web site any more difficulty by storing connection strings in an