connection-string

IBM .NET Data Provider Connection String issue with Library List

偶尔善良 提交于 2019-12-24 02:25:17
问题 I am trying to use the DB2 .Net Data Provider in a C# program rather than relying on ODBC. The connection string below works, but only for one library (say my libraries are test1 and test2). Data Source=xxx.xxx.xxx.xxx;User Id=testuser;Password=testpassword; Naming=SQL;Default Collection=test1; If I add "Library List=test1, test2;" (I have tried several variations of that) to the connection string, it does not allow me access additional libraries, only what is defined in defaultcollection. I

Azure error - connection string difficulties

限于喜欢 提交于 2019-12-24 02:14:19
问题 I am working with an mvc5 application in vs 2015. I am getting errors whenever I attempt to access items from the database Login failed for user '{your_username}'. When I go azure portal "allow access to azure services" setting is on with my client Ip address listed. I think my connection string is not configured correctly. I can't figure out how to correctly configure it on my local machine and with azure. I have kept my the connection string in my web config to my local server which worked

How to pass connection string from appsettings.[name].json to DbContext in .NET Core?

痴心易碎 提交于 2019-12-24 01:46:19
问题 I have a .net core app. I write my connection string in appsettings.json file. But, now, I want to get that connection string for my context. How to do that? In .net framework 4.6 I used this: ConfigurationManager.ConnectionStrings["ConnStrName"].ConnectionString; I have appsettings.Development.json like this (*** could be any name): "ConnectionStrings": { "***": "Server=***;Database=****;Trusted_Connection=True;MultipleActiveResultSets=true;" } I added service: services.AddTransient

EDMX Connectionstring 'name'

我的未来我决定 提交于 2019-12-24 00:57:55
问题 We have generated this connectionstring (below) via Edmx: <add name="Connection" connectionString="metadata=res://*/Code.aa.csdl|res://*/Code.aa.ssdl|res://*/Code.aa.msl;provider=System.Data.SqlClient;provider connection string="data source=server.com;initial catalog=db_name;persist security info=True;user id=user;password=pwd;multipleactiveresultsets=True;application name=EntityFramework;"" providerName="System.Data.EntityClient" /> However, running the application will get us the following

ConnectionString property has not been initialized

随声附和 提交于 2019-12-24 00:48:12
问题 I've looked at a lot of posts on different forums where others have received the same error. Most say they were not referencing the connectionstring from the web.config file correctly, or they were trying to open the connection before setting the connectionstring. Well, if that were the case for me, then how does it work on two different systems, but not on the third? It works on my development PC and on the development server, but not in the production environment. The difference is the web

How do you Configure the Connection String for ODP.NET Connection String with FailOver?

老子叫甜甜 提交于 2019-12-23 21:58:43
问题 Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is what I use with System.Data.OracleClient. SERVER=(DESCRIPTION_LIST=(LOAD_BALANCE=yes)(FAILOVER=ON)(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.80)(PORT=9960))(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.81)(PORT=9960)))(CONNECT_DATA=(SERVICE_NAME=tactota))));uid=XXXXXXX;pwd=XXXXXXXX" Here is what I have gotten to work with ODB.NET, but does not implement the other

SQL Server connection string keywords act as case sensitive although they shouldn't be

≯℡__Kan透↙ 提交于 2019-12-23 15:12:53
问题 I use .NET's OdbcConnectionStringBuilder to update a connection string read from a config file, which makes its keys lower case, as documented by MS ("Data Source" -> "data source"). The connection string is used to access MS SQL Server (2008, if it makes a difference). It works fine on my machine (Windows 7 32 bit), and according to MS's documentation it should work: Keywords are not case sensitive However, on several other machines (at least some are 64 bit), the connection to DB could not

Connection using enlist=false does not close after being manually enlisted in distributed transaction

耗尽温柔 提交于 2019-12-23 15:11:58
问题 I have a distributed transaction context using ServiceDomain . Inside it, I open an SQL connection with connection string specifying Enlist=false , so that it is not automatically enlisted in the transaction. Then, if I manually enlist the connection in the distributed transaction using EnlistDistributedTransaction , the connection does not get closed, which can end in an InvalidOperationException with: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.

SQLite Connection not working in C#

随声附和 提交于 2019-12-23 13:07:55
问题 I was working with C# Application that manipulates a SQLite Database , Till yesterday It was working fine, It was retrieving records, But since last night, Connection String returns Data Source = null Below is the Test Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SQLite; namespace SQLiteTest { public partial class Form1 : Form { /

ConnectString didn't work in C#

。_饼干妹妹 提交于 2019-12-23 13:02:43
问题 public static DataSet ParseDatabaseData(string sheetName) { string connectionString = "Provider=System.Data.SqlClient;Data Source= MHSPC56888_VM1\\SQLEXPRESS;Initial Catalog=xxxxxxx;User id=xx;Password=xxxxx;"; SqlConnection conn = new SqlConnection(connectionString); string strSQL = "SELECT * FROM [" + sheetName + "$]"; SqlCommand cmd = new SqlCommand(strSQL, conn); conn.Open(); DataSet dataset = new DataSet(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dataset); conn