Questions tagged [connection-string]

1

votes
2

answer
1.9k

Views

How to read connection string inside .NET Standard Class library project from ASP.NET Core

In my solution, I have a ASP.NET Core web project and a .NET Standard class library project. Class library project is the data access layer and I want to read the connection string from my appsettings.json (ASP.NET Core project) in my data access layer. I have found few answers such as by Andrii Li...
Learning Curve
1

votes
2

answer
12.2k

Views

connectionString outside SQL server with App.config file

I have a console application and in the App.config I need to add a connectionString to another SQL server that is in the same network. If I try the connectionString to a local server by only passing the Server='localhost' its worked but I cannot make it work for an outside server. Thanks Here is the...
A arancibia
1

votes
3

answer
503

Views

How to build connection string from existing connection for new database created dynamically?

I have query to dynamically create database. private void ExecuteNonQuery(string sql) { using (var connection = new SqlConnection(_connectionString)) { connection.Open(); SqlCommand command = connection.CreateCommand(); command.CommandText = sql; command.ExecuteNonQuery(); } } private void CreateDat...
Sachin
1

votes
1

answer
549

Views

Entity framework 6 dynamic connections string using DI

I have a unit of work with the repository pattern with simple injector implemented and I need to change my connection string dynamically. Currently the connection string is taken from the web config. I need the connection string be taken from the database. So I will have a database with the ASP.Net...
Wheels
1

votes
0

answer
35

Views

VBA machine info and/or drivers available

We have some code in VBA that uses a connection string to open an MDB. We have found that the connection string has to change depending on the machine - it seems that .Jet.4 is no longer available on modern OS's (?) and that we need to use ACE.12 instead. But other machines support Jet.4 fine. Great...
Maury Markowitz
1

votes
0

answer
28

Views

Dynamic connection to Database ASP.NET

I want write autorization system in asp.net - user of Postgres (which created throws CREATE ROLE...) entering login and password and working with own tables. Problem is i working in ASP.NET core and connecting throws Dapper. appsettings.json { 'Logging': { 'IncludeScopes': false, 'LogLevel': { 'Defa...
Travis Bincle
1

votes
0

answer
279

Views

Connecting Spring Boot app to the MySQL Database

I have created a Spring Boot app and I am trying to connect the same to MySQL database. The database.sql file that I have included looks like below: Database.sql snapshot However, for some reasons, I am unable to select any Name and Database options from the down drop. However, I am able to run th...
P.K.
1

votes
0

answer
253

Views

Adding/Removing SQLite database password programmatically

Trying to create functions to programmatically add a password to the sqlite database, and remove it - to get rid of the password when in debug. I followed the steps of the best post explaining it (https://stackoverflow.com/a/1385690/6617804) and all the other sources that I found are using the same...
Gaël
1

votes
0

answer
72

Views

Different behaviors in similar SQL Server connection string using C#

I have encountered a situation which looks weird to me. Though I have figured out another simpler way for my code to work but I'm curious to know as why this is happening. Here is the code that works absolutely perfect : public DataHelper() { this.dataSource = 'MyMachine'; this.initCatalog = 'myDB';...
1

votes
0

answer
23

Views

The system cannot find the file specified while getting data from database

I've been uploading my mvc project on somee but keep getting this error I always get this error when I try to get data from the database An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it or...
Talha Waseem
1

votes
1

answer
331

Views

Oracle connection string to use Oracle Native Client 12 specifying driver

I have simple c# application that conencts to Oracle 12c. User provides information about their Oracle server: host, port, service name, user name and password. On the machine where application is launched i have 'fat' Oracle Native Client 12.02.00.01 installed together with my app. I need a connect...
tkond
1

votes
0

answer
344

Views

excel connection string - relative path

I have a connection string in an Excel Spreadsheet that links to other spreadsheets. All works well. However, the file and directory are written as absolute. Can this be relative? There are two files in the same directory N:\Files\ProjectName\Clients\Alpha\Project.xlsm and N:\Files\ProjectName\Clien...
1

votes
0

answer
195

Views

Entity Framework connection string in Service Fabric configurations

I'm trying to run existing WCF service as a stateful reliable service. The WCF service uses EF4's object context API that requires connection string in the form of Previously the service could easily find this connection string from config file by referencing to its name. Now in Service Fabric I hav...
Saad
1

votes
0

answer
909

Views

A connection was established with the server, but then an error occurred during the pre-login handshake

I am currently trying to connect to a PostgreSQL database table and query some values, but I am not able to do so as I am always getting the following error: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider,...
user7335295
1

votes
2

answer
179

Views

Read SQL Server query for ADODB.Connection from external file or from variable

I have this Excel VBA code: Sub ConnectSqlServer() Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim sConnString As String Dim query As String ' Create the connection string. sConnString = 'Provider=SQLOLEDB;Data Source=xxxx.xxx.xxxx.xxx,xxxx;' & _ 'Initial Catalog=mydb;' & _ 'Trusted_Conne...
user3412266
1

votes
1

answer
172

Views

Revit API, Access Database, Attempted to read or write protected memory

I recently upgraded from R16 to R19, but my addin throws an error I can't resolve. When I try to read an access.mdb file, I get the 'attempted to read or write protected memory' error. I use the exact same code to connect to this file in an Acad2019 dll, there it works fine. Same happens on a differ...
Piet
1

votes
1

answer
169

Views

read ConnectionString from appsettings.json for entity.Framework

i try to read a ConnectiongString from appsettings.json for entityFramework and MySQL, but i get the error: System.ArgumentNullException: Value cannot be null. Parameter name: connectionString this is my appsetings.json: { 'Data': { 'ConnectionStrings': { 'DefaultConnection': 'server=database;userid...
eldios1981
1

votes
1

answer
46

Views

How to to load a Pandas Data frame to Redshfit Server using OBDC driver?

I am relatively new to Python programming. I have searched previously answered questions related to this thoroughly but couldn't find a good solution. Problem: I am intending to use the ODBC driver installed in my system to connect to Red-shift database. All entities - (Servername, host, port, Usern...
Abhi Garg
1

votes
0

answer
42

Views

Hide connect string from OraConnection object

When we create an Oracle connection in R with ROracle package, we create an 'OraConnection' object. Usual command example: connect = paste0('(DESCRIPTION=(LOAD_BALANCE=yes) (ADDRESS=(PROTOCOL=TCP) (HOST=', id$host, ') (PORT=', id$port, ')) (CONNECT_DATA=(SERVER=dedicated) (SERVICE_NAME=', id$servi...
Romain Divouron
1

votes
0

answer
125

Views

The network path was not found when sqldatasource in aspx loads

I am using ASP.NET with c# and MySql, the database is on a hosting provider.I am using sqldatasource in aspx but I am getting the error below. When my sqldatasource : My connection string is : My connection string credentials are correct because before this page I have a login page and I connect ju...
marios
1

votes
1

answer
191

Views

Uncaught Error: Class 'WindowsAzure\Common\ServicesBuilder' not found- MS Azure | PHP

I have created the composer.json file in my root folder where my index.php file is presents, with the following code in it: { 'require': { 'microsoft/windowsazure': '^0.5' } } and on downloading composer.phar, I have installed it using: php composer.phar install I'm trying to create a table and add...
Prachi
1

votes
1

answer
50

Views

Connection String issue with inserting SQL Server

I am having some issues with inserting into my database. I'm hosting my website using Plesk and myLittleAdmin holds with my a SQL Server database. The issues is that I can edit and delete items from a management page that shows all the items in the database, but as soon as I try add/insert an item i...
Barry Sturgeon
1

votes
0

answer
329

Views

unable to connect from hibernate 5 to mysql 5.7

I am trying to learn hibernate and wrote some basic code to connect MySQL database on my laptop, but I get the below error. Oct 02, 2018 5:28:51 AM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.3.6.Final} Oct 02, 2018 5:28:51 AM org.hibernate.cfg.Environment INFO: HHH000206: h...
purojit kulkarni
1

votes
2

answer
148

Views

Pandas connect to Oracle Db without connection string

I need to read data form an Oracle db (with pandas). I'm using the cx_oracle libraries. The tutorial suggest to use this instruction to create a connection: connection = cx_Oracle.connect(username, password, connectString) I don't have the connection string but the host, db_name, user and password....
paolof89
1

votes
1

answer
434

Views

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' error in aspx page of dynamics CRM

SSPI security failed to connect from application server to remote database server. I am trying to edit the web.config in an aspx page which is embedded in Dynamics CRM. The previous web.config connectionstring is like below: Due to security concern, now I need to change the integrated security to SS...
Hongxuan
1

votes
0

answer
21

Views

real escape string to multiple connection

it is possible to have multiple connection for one variable in real_escape_string? my problem is that i need to insert the same $_POST into two diferent DB. please see here:
Stefano Zanetti
1

votes
0

answer
79

Views

Could not connect to redis Instance at hostname:6379 in docker-compose

I am starting a dotnet core app and redis using docker-compose. Redis hostname is set to container name used in the docker network. The redis connection manager in service stack is setup using the connection string. However, it seems to always default back to localhost:6379 This has worked 2 weeks a...
MarcoB
1

votes
1

answer
23

Views

Get Azure connection string in datalayer

Someone thought, a long time ago, it was a good idea to add connections string hardcoded in the datalayer of our web api. Because of this legacy I cannot remove this class. This class inherits IDbContextFactory and it needs to retrieve a connection string, which now is hard coded. To make it more......
Johan Frijhof
1

votes
1

answer
46

Views

Sequelize unable to connect to SQL Server through network

My setup is the following: I have a Virtual Machine running all of my Database processes, let's call it DB-VM. I'm currently developing at my own workstation (completely detached from DB-VM, except that we are under the same network. I've created a valid connection string, validated by another datab...
rnarcos
1

votes
0

answer
32

Views

connect to oracle DB using TnsNames Alias

In my TnsNamesOra I have TEST11.12.13.14 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.13.14)(PORT = 1234)) ) (CONNECT_DATA = (SERVICE_NAME = TESTNAME) ) ) If my connection string looks like this: Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HO...
David
1

votes
3

answer
45

Views

How to define connection string and database provider in an C# application when the Entity Framework model is in a dedicated class library?

I'm creating a set of desktop applications (C#, .NET Framework 4.7), that all use the same database and models. I'm using Entity Framework 6 to setup the database models. To prevent having duplicate code (models), I placed all the models in a dedicated 'database' class. In this class, I also define...
burnersk
1

votes
1

answer
71

Views

Where to store encrypted passwords and retrieve it? [closed]

I have few legacy Visual Basic 6 applications, few C# Windows applications and few Web applications. I don't have permission to deploy in production nor have access to production. In database connection strings, we want to store encrypted password. How should we manage the key to decrypt the passwo...
RKh
1

votes
2

answer
16.4k

Views

Provider needed to be specify on a connectionstring?

I have a very funny problem on my application, I get an error as follow: System.ArgumentException: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. However, when I tried to speicify the provider on my connection as Provider=SQLOLEDB.1 or Provid...
PlayKid
1

votes
1

answer
1.3k

Views

IIS 7 And Failover Partner

I'm trying to migrate a few asp.net applications from iis 6 to iis 7 and I've run into a few snags along the one. I can't find any documentation for the issue I'm seeing and wanted to see if someone else has encountered the same problem. I'm using SQL Server 2005 db mirroring on my databases. In t...
1

votes
3

answer
139

Views

How to connect to DB on SERVER for Asp.Net membership?

I've just upload my ASPNETDB.mdf using 'Generate Scripts' into server. The problem is, I don't know how can I connect to it for my Membership.(e.g LogIn Controls) where is the ConnectionString?
mammadalius
1

votes
3

answer
1.7k

Views

WPF/C# - test connection string and fail elegantly

I've got a WPF application that uses LINQ to SQL DataContexts. What's a 'best practice' way of testing the database connection and letting the user know that the connection is either bad or the network is down, etc, so that the app doesn't just bomb. Right now, I get the Splash Screen and then a 'Pr...
1

votes
1

answer
1k

Views

SubSonic 2.1 using multiple databases

I want to use SubSonic 2.1 to connect to 2 different databases (each having different tables). What is the best way to do this? What is the best way to seperate the generated code between the 2 databases and how can I switch between databases?
1

votes
4

answer
2.8k

Views

Joomla Cant Connect to DB

This sounds really easy to fix but I've been working on it for awhile. Database Error: Unable to connect to the database:Could not connect to MySQL I had to make a local copy of Joomla for backup and changes so I didn't mess up the live site. I grabbed all the files off the live site via FTP. Did a...
mmundiff
1

votes
1

answer
2.5k

Views

Log in and password using VB6 and Access 2007

I'm trying to create a VB6 application linking to Microsoft Access 2007. I'm going to save account names and passwords in Access 2007. I'm using VB6 as the front end. Would somebody help me on the connection string and the codes to store and check the account names and passwords.
gibz357
1

votes
1

answer
3.5k

Views

ConnectionString not read from web.config by a strongly typed Dataset? SQLiteException (0x80004005): unable to open database

Please some help on how to debug this! On my development machine I can succesfully host a local WCF service that uses a SQLIte database for its storage. I simply xcopied the wcf service dll's, the database file and the System.Data.SqLite.dll to the win 2008 server. The server hosts the the WCF serv...
Dabblernl

View additional questions