connection-string

Separate ConnectionStrings and mailSettings from web.config? Possible?

大兔子大兔子 提交于 2019-12-03 13:04:44
Is it possible to separate ConnectionStrings and mailSettings from web.config? Devel environment has different IP addresses for connectionstrings and smtp mails because of development and testing. We dont want to do tests and devel using live machines and live IP addresses. Is it possible? I found the answer on MSDN: <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

How can I safely store and access connection string details?

这一生的挚爱 提交于 2019-12-03 12:21:53
问题 I'm currently working on a ASP.NET MVC web site, and I've come up to a point where I need to integrate a database into the website. Normally I would simply add the appropriate connection string to the Web.config file: <add name="MainDB" connectionString="Server=localhost; Database=TopSecretData; User Id=Joe; password=password" providerName="System.Data.SqlClient" /> But there's obviously a glaring security flaw if I leave my User Id and password right in the Web.config , especially when it's

Excel VBA - connect to sql with a trusted connection (no uid/pwd)

家住魔仙堡 提交于 2019-12-03 12:17:23
Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/password in my code. I have this connectionstring in an Excel 2003 VBA project... "Provider=SQLOLEDB;Data Source=[You DB Name];Trusted_connection=yes;" And it works for me! (I'm using ADODB) Driver={SQL Native Client};server=servernamehere;database=dbnamehere;Trusted_Connection=yes; http://www.sqlstrings.com/SQL-Server-connection-strings.htm http://www.connectionstrings.com/sql-server Try this one:

unable to retrieve metadata for unrecognized element providers

ε祈祈猫儿з 提交于 2019-12-03 10:55:51
I get a message error whenever I try to add a controller with Entity framework template but I keep getting a error message unable to retrieve metadata for 'path' unrecognized element providers. (C:\Users\user\appdata\local\Temp-mp6124.tmp line 78) I know it's something related to connection string so here is my connection string <connectionStrings> <add name="NoktatyContext" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=NoktatyContext-20140122154208; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|NoktatyContext-20140122154208.mdf"

Building a connection URL for mssql+pyodbc with sqlalchemy.engine.url.URL

回眸只為那壹抹淺笑 提交于 2019-12-03 10:14:52
问题 The problem... I am trying to connect to a MSSql server via SQLAlchemy. Here is my code with fake credentials ( not my real credentials obviously ). The code... credentials = { 'username' : 'SPOTTER_xyz_ACC', 'password' : '123Goodbye2016!@#', 'host' : 'MARYLQLT01', 'database' : 'LRS_DUS', 'port' : '1560'} connect_url = sqlalchemy.engine.url.URL( 'mssql+pyodbc', username=credentials['username'], password=credentials['password'], host=credentials['host'], port=credentials['port'], query=dict

web.config transform - delete comments from connectionstring section

纵饮孤独 提交于 2019-12-03 09:44:20
I store several different connection strings in my web.config for development and testing. All but one is commented out so I can change info as needed. When I publish, I would like to replace everything (including comments) in the connectionStrings node with this: <add name="myDb" connectionString="Data Source={SERVER};Initial Catalog=ManEx;User Id={USER};Password={PASSWORD};" providerName="System.Data.SqlClient" /> <!--<add name="myDb" connectionString="Data Source={SERVER};Initial Catalog=ManEx;Integrated Security=True" providerName="System.Data.SqlClient" />--> I know how to change the

SQL providerName in web.config

心不动则不痛 提交于 2019-12-03 09:18:26
We are using ASP.NET (Framework 2) and setting database connection strings (SQL2005) in web.config. We are currently using " providerName=SqlServer ". All our data accesses are done using System.Data.SqlClient - should we therefore change to providerName=System.Data.SqlClient ? I find many examples of this providerName on the web, but very little explaining what providerName=SqlServer actually means. Is there a difference? I'm worried that the providerName we currently specify is actually referencing a legacy (and maybe slower) client, or is there an even more efficient client than SqlClient

DefaultConnection and membership - what is the connection between localsqlserver and defaultconnection

狂风中的少年 提交于 2019-12-03 08:36:40
Hmmmm... I really can't get my head around this. In web.config I have: <connectionStrings> <clear /> <!--- need this to prevent using LocalSqlServer from machine.config or somewhere becouse it is not present when when publish to hosting --> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-Goaly-20120615111028;Integrated Security=SSPI" /> </connectionStrings> and <membership defaultProvider="DefaultMembershipProvider"> <providers> <!-- I think this line is telling asp.net that I want the membership working

How to vary connection string for different work locations

血红的双手。 提交于 2019-12-03 08:23:55
I am working on a C# 4.0, WPF 4.0, SQL 2008 project and I do work at home and in the office. I just setup SubVersion using Visual SVN per the recommendations found in other questions. The problem I am having is the connection string for the database is different for each location. At home I have the database on my dev system, in the office the database is on our server. Neither is exposed to the internet so I have to use both. Is there an elegant way to automatically select the correct one? Update I have been having ongoing issues with this and am trying to balance learning version control

Single Connection String with Multiple Entity Framework Models?

馋奶兔 提交于 2019-12-03 08:02:32
At work we currently have a very large web application with a connection to a massive database. We have been using Entity Framework for a while now and to make things easier we divided the database into many Entity models. This works well for us but we ran into an issue. Each EF model needs its own connection string due to the metadata part of the connection string. Managing so many connection string is a pain. Now I have a solution that I think will work. I am going to create a class that will have the metadata info saved as a property also concatenated to the standard connection string in