connection-string

What is the exact format of a connection string for Oracle?

蹲街弑〆低调 提交于 2019-12-13 08:41:57
问题 I have this code: string conStr = @"server=ORACLE1001;database=Test;uid=admin;pwd=1234"; mycon = new OleDbConnection(); mycon.ConnectionString = ConStr; and it throws exception that provider must be like "Provider=SQLOLEDB;" so I tried with conStr = "Provider=OraOLEDB.Oracle.1;server=ORACLE1001;database=Test;uid=admin;pwd=1234; and it throwed exception "ORA-12560: TNS:protocol adapter error" - anny ideas how to fix this? Any ideas what is wrong with my conStr? 回答1: Please follow the steps and

Does Godaddy support database connections to App_Data mdf databases?

↘锁芯ラ 提交于 2019-12-13 08:35:47
问题 Quite simply, what is the correct connection string to an mdf file database located in the App_Data directory of my asp.net website hosted on Godaddy? Naturally this works offline in my developer environment but causes problems when uploading to Godaddy. Does Godaddy support connecting to databases contained within the App_Data directory? I suspect my problem is the Data Source portion and selecting a SQL Server instance but I'm not sure. I clear the "LocalSqlServer" connection before adding

How to track what adds a 'DefaultConnection' connection string to web.config of my MVC app

假如想象 提交于 2019-12-13 06:52:00
问题 I have a weird problem - I have noticed that after web deployment of my MVC app, a new connection string is added to web.config file. <add name="DefaultConnection" connectionString="DefaultConnection_ConnectionString" providerName="System.Data.SqlClient" /> I have no idea where it comes from, something adds it automatically. Here is my web.config file after publishing <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="entityFramework" type="System.Data

Using $dsn string variable as parameter in database PDO

柔情痞子 提交于 2019-12-13 06:02:02
问题 Goal: to simply fetch array from a MySQL database. Issue: I am using the $dsn "string variable" as a parameter in the PDO Statement but there appears to be an uncaught exception and it has something to do with invoking the driver or the (PDO->__construct) -- I am not sure. Do you have any ideas on how to fix the $dsn string variable or other areas of this code that would cause it to fail? Thanks in advance. // Define Database Parameters $dbhost = "localhost"; $dbname = "x"; $dbuser = "y";

EF Codefirst Winforms app - Connection string problems

血红的双手。 提交于 2019-12-13 05:25:31
问题 I've been trying to build a code first desktop app - it works fine on my dev machine, but, I seem to be having so many errors trying to deploy it. The main one at the moment that I can't work out is that when running, I get the following error: Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately. Expansion of |DataDirectory| failed while processing

Why doesn't DataDirectory change on run time

匆匆过客 提交于 2019-12-13 05:19:29
问题 I am tring to connect to a local database with w winform c# application when i set my connection string to Data: Source=C:\Users\PACKARD BELL\documents\visual studio 2010\Projects\GestionStock\MyApp\Mydb.sdf it works fine but when i set it to Data Source=|DataDirectory|\Mydb.sdf it dosen't work i tried to print the connection string with the data directory variable in the console and i found that it dosen't change i want the connection string to change with the location of the application

How do I give a connection string to a server on a network?

做~自己de王妃 提交于 2019-12-13 05:13:02
问题 I'm using SQLite so it's only a file, not a server, but here's the plan: Install the application + the physical .sqlite file on a machine and on another machine over the network, let the other user connect to the .sqlite file. So I'd have to share that folder and give it permissions to allow everyone to read and write from it. Here's my App.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrings> <add name="ColegioMentorEntities" connectionString="metadata=res://*

Encrypting ODBC DSN login password programmatically

我怕爱的太早我们不能终老 提交于 2019-12-13 04:18:57
问题 I am using file DSN for connecting to Sybase database. Login password is encrypted and is stored with EncryptedPassword keyword in the .dsn file. I have the requirement to change the database password and update the DSN accordingly. I am using SQLDriverConnect to connect to the database and SQLWriteFileDSN to modify the .dsn file. Is there any way to encrypt the new given password same way Sybase does(keyword or special tag or some thing?).? Some limitation: I know its not recommended to

IBM DB2 Core: Connection string for ASP.NET Core 2.1 and Microsoft Enterprise Libraries

守給你的承諾、 提交于 2019-12-13 03:21:02
问题 I'm using this Microsoft.EnterpriseLibrary port for .Net Core. It requires a configuration file app.config with the connection string specified in it. I tried using the same connection string I use in another working project, but it doesn't work here. How can I specify a DB2 connection string for ASP.NET Core 2.1? I this is what I have tried: <connectionStrings> <add name="Development" connectionString="server=MY.SERVER.COM:446;database=DBXX;user id=USERXX;password=PASSWORDXX;" providerName=

passed dbcontext connection string to DALayer

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:59:11
问题 I have 4 layer in my application UI , DomainClass , Model(DBCntext) , Repository . In repository i have an abstract class like this : public abstract class GenericRepository<C, T> : IGenericRepository<T> where T : class where C : DbContext, new() { private C _entities = new C(); public C Context { get { return _entities; } set { _entities = value; } } public virtual IQueryable<T> GetAll() { IQueryable<T> query = _entities.Set<T>(); return query; } public IQueryable<T> FindBy(System.Linq