connection-string

How To Access Azure Function App ConnectionString Using dotnet Standard

我怕爱的太早我们不能终老 提交于 2019-12-01 05:50:45
My Azure Function App has a ConnectionString defined. I want to retrieve it from a C# function written in dotnet standard 2.0. I have tried adding System.Configuration.ConfigurationManager to the project.json and using var str = ConfigurationManager.ConnectionStrings["my string"].ConnectionString; but I get the error run.csx(24,15): error CS0103: The name 'ConfigurationManager' does not exist in the current context How do I access the connection string? Crazy Crab ConfigurationManager is not available in Azure Functions v2 .NET Standard projects. Azure FUnction v2 now uses ASPNET Core

With VBA, find the version of the the MySQL ODBC driver installed in Windows

你说的曾经没有我的故事 提交于 2019-12-01 04:11:47
Using Visual Basic for Applications , how can I find out which version of the MySQL ODBC driver is installed in Windows on a user's machine? I have a Microsoft Access application that uses the MySQL ODBC driver to make a connection. The connection string looks like this: ODBC;DATABASE=mydatabase;DRIVER={MySQL ODBC 3.51 Driver}; OPTION=3;PWD=password;PORT=3306;SERVER=server-db;UID=db-user; This was working find until the IT manager installed version 5.1 of the MySQL ODBC driver on a user's PC, which broke my connection string. If I knew the version of the driver installed on the user's Windows

Where to place connection string in web.config

时光怂恿深爱的人放手 提交于 2019-12-01 03:52:25
My web.config looks like this : <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, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <appSettings> <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> <add key=

ASP.NET connection string metadata syntax

不羁岁月 提交于 2019-12-01 03:08:06
I'm new to ASP.NET-ville, be gentle. I have been troubleshooting a ASP.NET setup, where the server/database values are changing, therefore web.config needs to be updated. There are multiple <add name="NameXYZ" connectionString="blah" /> instances (multiple ASP.NET components), but some of these are marked up differently to others. I've got the following provided: <add name="CONNECTION-B" connectionString="metadata=res://*/ZZZZ.ssdl;provider=System.Data.SqlClient;provider connection string="Data Source=XXX;Initial Catalog=YYY;Persist Security Info=True;User ID=AAA;Password=BBBB

Overriding code-generated DbContext constructor

落花浮王杯 提交于 2019-12-01 03:08:06
I'm sure I've done this before at some stage, but I can't figure out how to now! My scenario: // This is generated from EDMX public partial class HOLDbEntities : DbContext { public HOLDbEntities() : base("name=HOLDbEntities") { } } Now, I want this connection string to be easily changeable (I want to Implement from the HOLDbEntities), so I need to override this constructor. I've tried: public partial class HOLDbEntities { private const string _contextName = "HOLDbEntities"; public static string ContextName { get { return _contextName; } } public HOLDbEntities() : base(ContextName) { } } But

Is there a difference between (local), '.' and localhost?

亡梦爱人 提交于 2019-12-01 02:06:19
I've used all three of these when making local programmatic connections to databases. Is there any real difference between them? The final result is the same. The difference is: 'localhost' resolves at the TCP/IP level and is equivalent to the IP address 127.0.0.1 Depending on the application "(local)" could be just an alias for 'localhost'. In SQLServer, '(local)' and '.' mean that the connection will be made using the named pipes (shared memory) protocol within the same machine (doesn't need to go through the TCP/IP stack). That's the theory. In practice, I don't think there is substantial

how to use `charset` and `encoding` in `create_engine` of SQLAlchemy (to create pandas dataframe)?

坚强是说给别人听的谎言 提交于 2019-12-01 01:50:48
问题 I am very confused with the way charset and encoding work in SQLAlchemy . I understand (and have read) the difference between charsets and encodings, and I have a good picture of the history of encodings. I have a table in MySQL in latin1_swedish_ci ( Why? Possible because of this) . I need to create a pandas dataframe in which I get the proper characters (and not weird symbols). Initially, this was in the code: connect_engine = create_engine('mysql://user:password@1.1.1.1/db') sql_query =

EF7 change connectionstring at runtime

耗尽温柔 提交于 2019-12-01 01:46:16
In the previous versions of EF we were able to alter the dbcontext connection string as below : context.Database.Connection.ConnectionString = "the new connectionstring"; How can we do this with EF7? Thank you I found the solution : https://github.com/aspnet/EntityFramework/wiki/Configuring-a-DbContext#config-from-external-code Context Code public class BloggingContext : DbContext { public BloggingContext(DbContextOptions options) : base(options) { } public DbSet<Blog> Blogs { get; set; } } Application code var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlServer(@

Force the TCP/IP protocol in connection string

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 01:33:56
问题 i have a database driven website written in asp.net. i'd like to modify the connection string to force protocol TCP. Please advise. Thanks! 回答1: You can use server=tcp:hostname in your connection string to achieve this. For more details, see How to use the server name parameter in a connection string to specify the client network library 来源: https://stackoverflow.com/questions/4430381/force-the-tcp-ip-protocol-in-connection-string

Overriding code-generated DbContext constructor

寵の児 提交于 2019-11-30 23:20:02
问题 I'm sure I've done this before at some stage, but I can't figure out how to now! My scenario: // This is generated from EDMX public partial class HOLDbEntities : DbContext { public HOLDbEntities() : base("name=HOLDbEntities") { } } Now, I want this connection string to be easily changeable (I want to Implement from the HOLDbEntities), so I need to override this constructor. I've tried: public partial class HOLDbEntities { private const string _contextName = "HOLDbEntities"; public static