connection-string

The web publishing extension is not installed which is required to publish

我只是一个虾纸丫 提交于 2019-11-29 09:27:20
I was tring to deploy an ASP.NET Web Application to a Windows Azure Web Site by following the tutorial through this link: https://www.windowsazure.com/en-us/develop/net/tutorials/get-started/ After download the public profile, which is a ".PublishSettings" file, I go back to Visual Studio and right-click the project in Solution Explorer and select Publish from the context menu as the tutorial said. However, a warning box jumped up and it showed me that "The Web Publishing extension is not installed which is required to publish. You can install it from http://go.microsoft.com/fwlink/?LinkID

error occurred while establishing a connection to SQL Server

梦想与她 提交于 2019-11-29 09:23:52
If I have my connection string in the web.config like this (added line feeds for better readability): <add name="conn" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=MyDB; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=D:\Products.mdf" providerName="System.Data.SqlClient"/> The connection works and I can connect to the database in the database explorer. When I specify the connectionstring in code or use ConfigurationManager to get it it doesn't work: SqlCommand command = new SqlCommand(); command.CommandText = "select ..."; command.CommandType =

How to check for the existence of a DB?

[亡魂溺海] 提交于 2019-11-29 07:24:40
I am wondering if there is an elegant way to check for the existence of a DB? In brief, how do test the connection of a db connection string? Thanks Set the Initial Catalog=master in the connection string and execute: select count(*) from sysdatabases where name = @name with @name set to the name of the database. If you want to check the connection string as a whole (and not existence of an independent database), try connecting to it in a try/catch block. You could just try connecting to it. If it throws an exception, then the connection string is bad in some way, either the database doesn't

Using a separate file to maintain the connection string for entity framework

僤鯓⒐⒋嵵緔 提交于 2019-11-29 07:16:24
I have my connection string currently in my web.config file. Is it possible to place it in a separate file and point entity framework to it. Mortalus I found the answer here Separate ConnectionStrings and mailSettings from web.config? Possible? : <configuration> <connectionStrings configSource="connections.config"/> </configuration> With file connections.config containing <connectionStrings> <add name="name" connectionString="conn_string" providerName="System.Data.SqlClient" /> <add name="name2" connectionString="conn_string2" providerName="System.Data.SqlClient" /> </connectionStrings> In

Multiple SQL Server connection strings in app.config file

自作多情 提交于 2019-11-29 06:10:51
I'm interested in displaying in a Windows Forms app a list of N radio buttons for the user to choose a target database server. I would like to add the SQL Server connection strings in the app.config file, so they are read by the app at runtime and rendered in the windows form as radio buttons. At first I thought of using a delimiter to separate the connections <appSettings> <add key="ConnectionString" value="connection1|user id=user;password=123;server=10.0.0.1;database=myDatabase;connection timeout=30|connection2|user id=user;password=123;server=10.0.0.2;database=myDatabase;connection timeout

How do you put environmental variables in web.config?

被刻印的时光 ゝ 提交于 2019-11-29 05:38:35
I am currently Following these tutorials , and I am wanting to call the clear text string from Azure's Application Settings for Web Apps. I am under the impression that environmental variables are used for non-config files . However, I am wanting to use the same methodology for web.config files. <connectionStrings configSource="/config/ConnectionStrings.config"> <add name="DefaultConnection" connectionString="@Environment.GetEnvironmentalVariable('SQLAZURECONNSTR_DefaultConnection')" providerName="System.Data.SqlClient" /> </connectionStrings> <appSettings file="config\AppSettingsSecret.config

ADODB Connection String: Workgroup Information file is Missing?

随声附和 提交于 2019-11-29 04:50:45
I have a few data sources in access that I need to connect to programatically to do things with behind the scenes and keep visibility away from users. Said datasource has a password 'pass' as I'm going to call it here. Using this connection method I get an error attempting to use the open method Dim conn as ADODB.Connection Set ROBBERS.conn = New ADODB.Connection conn.open "Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source=\\pep-home\projects\billing\autobilling\DPBilling2.mdb;" _ & "Jet OLEDB:Database Password=pass;", "admin", "pass" "Cannot start your application. The workgroup information

Getting “StorageConnectionString” from ServiceRuntime: FAIL

拈花ヽ惹草 提交于 2019-11-29 04:37:37
I connect to a blob store programatically: string connectionString = CloudConfigurationManager.GetSetting("StorageConnectionString"); CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); ... My App.Config settings are: <configuration> <appSettings> <add key="StorageConnectionString" value="DefaultEndpointsProtocol=http;AccountName=ACNAME;AccountKey=MYKEY==" /> </appSettings> ... The connection works. However I see the message "Getting " StorageConnectionString" from ServiceRuntime: FAIL " on my

Microsoft Excel Data Connections - Alter Connection String through VBA

一曲冷凌霜 提交于 2019-11-29 04:35:12
I have a fairly straightforward question. I am trying to find a way to alter and change a connection string for an existing data connection in an excel workbook through VBA (macro code). The main reason I am trying to do this is to find a way to prompt the user that opens up the workbook to enter their credentials (Username/Password) or have a checkbox for Trusted Connection that would be used in the Connection String of those existing data connections. Right now the Data connections are running off a sample user that I created and that needs to go away in the production version of the

EF 5.0 & dynamic connection string?

谁都会走 提交于 2019-11-29 04:22:51
One thing is driving me crazy right now. My (Database-first) EF-Model needs a dynamic connection string (IP-Adress of Server might change once in a while). So in older EF-Versions you could pass a connection-string via constructor, but that is not possible in 5.0 as is seems. What I have read so far, you could change your datatemplate, but that will be overwritten each time you re-generate your model etc., so not the best way to do it. Another thing is the SQLConnectionFactory, but that does not seem to work at all (Database.DefaultConnectionFactory = new SqlConnectionFactory( ... ) seems to