connection-string

SQLite EF6 programmatically set connection string at runtime

女生的网名这么多〃 提交于 2019-11-27 19:05:01
I try to migrate form EF 3.5 to 6 (with SQLite as database). We can not set the connection string in the app config file (this works without problems with ef6). We have to set connection string programmatically at runtime (after user has selected the SQLite file). Here is our app.config <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework,

Getting “StorageConnectionString” from ServiceRuntime: FAIL

北战南征 提交于 2019-11-27 18:30:13
问题 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

How do you put environmental variables in web.config?

陌路散爱 提交于 2019-11-27 17:29:55
问题 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')"

Encrypting the connection string in web.config file in C#

六眼飞鱼酱① 提交于 2019-11-27 17:22:41
问题 I have written the name of my database, username and password in my web.config file as connection string. I want to encrypt this data. How can I do it? <connectionStrings> <add name="ISP_ConnectionString" connectionString="Data Source=JIGAR; Initial Catalog=ISP;Integrated Security=True; User ID=jigar;Password=jigar123; providerName="System.Data.SqlClient" /> </connectionStrings> 回答1: You can just use the apnet_regiis tool to do that ,just do C:\WINDOWS\Microsoft.Net\Framework(64)\(.Net

Microsoft Excel Data Connections - Alter Connection String through VBA

拈花ヽ惹草 提交于 2019-11-27 17:02:37
问题 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

Encrypt connection string in NON ASP.Net applications

北城余情 提交于 2019-11-27 15:25:33
问题 I am working with C# & WPF and, of course, an app.config file. I have not been able to find an example of encrypted connection strings, stored in the app.config. There's plenty of examples for ASP.NET and web.config but nothing solid for app.config. The only examples I have come across clearly state that the string is only "decode-able" (is that even a word?) on the same machine that it was first encrypted on. Are there any viable options for working with encrypted connection strings (or

Excel macro to change external data query connections - e.g. point from one database to another

99封情书 提交于 2019-11-27 15:24:23
I'm looking for a macro/vbs to update all the external data query connections to point at a different server or database. This is a pain to do manually and in versions of Excel before 2007 it sometimes seems impossible to do manually. Anyone have a sample? I see there are different types of connections 'OLEDB' and 'ODBC', so I guess I need to deal with different formats of connection strings? I ended up writing the following, which prompts for the connection details, creates a connection string, then updates all external data queries to use that connection string. '''' Prompts for connection

error: the details of the application error from being viewed remotely

╄→гoц情女王★ 提交于 2019-11-27 15:08:17
I have 2 login pages: Login.aspx-for customer login and xlogin.aspx for admin login i just uploaded my project to the server and all application pages works great but when i log in the admin xlogin.aspx i'm being forwarded to the admin.aspx page - but i get this error: Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server

Linq to Sql - Set connection string dynamically based on environment variable

丶灬走出姿态 提交于 2019-11-27 13:41:50
I need to set my connection string for Linq to Sql based on an environment variable. I have a function which will return the connection string from the web.config based on the environment variable, but how do I get Linq to always use this "dynamically created" connection string (preferably without having to specify it every time)? I know I can specify the connection string using the constructor, but how does that work when using the datacontext in a LinqDataSource? Use: MyDataClassesDataContext db = new MyDataClassesDataContext(dynamicConnString); For a LinqDataSource, intercept the

sql server query running slow from java

半腔热情 提交于 2019-11-27 13:16:25
问题 I have a java program that runs a bunch of queries against an sql server database. The first of these, which queries against a view returns about 750k records. I can run the query via sql server management studio, and I get results in about 30 seconds. however, I kicked off the program to run last night. when I checked on it this morning, this query still had not returned results back to the java program, some 15 hours later. I have access to the database to do just about anything I want, but