Questions tagged [connection-string]
A string containing information necessary for connecting to a service, usually database.
connection-string
4,618
questions
11
votes
2
answers
4k
views
Entity Framework Core connect to MSSQL database over SSH tunnel
I've seen a lot of posts asking similar questions, but none of which solved the issue I have.
My setup is as follows:
Remote host with database: reachable on 127.0.0.1:1433
SSH tunneling: L5000 ->...
10
votes
4
answers
52k
views
Classic ASP - SQL Server 2008 Connection String using Windows Authentication
This should be painfully simple, but I cannot come up with a working connection string for a local copy of SQL Server 2008 using Windows Authentication. I've tried using the Data Link Properties tool ...
10
votes
1
answer
76k
views
SQL SERVER ODBC ERROR(Invalid object name) but when I add in SQL query mydb.dbo.mytable all works fine
I have an old asp.net 1 project (it works fine on old server, mytable exist in db. Now I am trying to upgrade it to asp.net 4
My connection string is:
<add key="SqlConnection"
value="DRIVER=...
10
votes
7
answers
31k
views
How Can We Have two Connection Strings In Web.Config And Switch Betweeen Them In Code Behind?
When I add two connection strings in the web.config, an error appears that tells me I can't add two connection strings in the web.config.
I want the upper job because I have 2 databases and I want ...
10
votes
4
answers
16k
views
How can I access SQLite with C#?
I'm trying to get connected to my Sqlite database programmatically using C#/ASP.NET:
string requete_sql = "SELECT * FROM USERS";
connStr = @"Data Source=C:\LocalFolder\FooBar.db;";
using (System.Data....
10
votes
5
answers
12k
views
How can I safely store and access connection string details?
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 ...
10
votes
4
answers
42k
views
.Net PostgreSQL Connection String
I am using PostgreSQL in a project I am working on, and one of the queries is timing out. I need to increase the timeout on the database connection, but since I am using my DAO through a complex ...
10
votes
1
answer
2k
views
In C# , how can I read a connection string stored in my web.config file connection string?
In C# class library, how can I read a connection string stored in my web.config file connection string tag? As in:
<connectionStrings>
<add name="CLessConStringLocal" connectionString="...
10
votes
11
answers
12k
views
C# - Opening Settings.settings gets error about invalid xml in app.config (when configSource added)
Following numerous examples, I added the following to my app.config file:
Everything seems to work when I run the application but when I try to open the Settings.settings file, I get the error:
"An ...
10
votes
4
answers
15k
views
How can I set read-only DB Connection Strings?
I've got a DB connection string that I'm creating in my web.config:
<connectionStrings>
<add name="DBConn" connectionString="Data Source=<db svr>;Initial Catalog=<...
10
votes
3
answers
18k
views
Difference between these connection strings?
Can anybody tell me the effective difference between the following connection strings:
<add key="ConnectionString" value="server=tcp:192.168.0.12\Sqlserver2005;database=;user id=sa;password=;">
...
10
votes
4
answers
26k
views
DSN to connectionstring?
We've got an ASP.NET website that uses a database that we want to be able to use a connectionstring to get to. We've successfully set up a DSN for connecting to this DB, but I can't seem to discover ...
10
votes
1
answer
19k
views
How to connect to MS SQL Server Express in JetBrains DataGrip?
I'm trying to set up new tool from JetBrains: DataGrip to work with my local install of MS SQL Server 2014 Express. I spent some time trying to "convert" ms connection string to jdbc, but no luck. I ...
10
votes
2
answers
10k
views
JDBC Connection String Syntax and Anatomy
I have used JDBC to connect to many different relational systems over the years: H2, HSQLDB, MySQL, Oracle, Postgres, etc. And in every case, each system seems to have its own flavor of connection ...
10
votes
3
answers
17k
views
ASP.NET: How to create a connection from a web.config ConnectionString?
How do you construct a DbConnection based on a provider name?
Sample provider names
System.Data.SqlClient
System.Data.OleDb
System.Data.Odbc
FirebirdSql.Data.FirebirdClient
i have connection ...
10
votes
3
answers
6k
views
Connecting to SQL CE db using SQLConnection
Pretty straightforward question. I'm building an app which reads data from a SQL Server 2005 instance. I wanted to run some tests on my laptop (which does not have SQL 2005) so I was looking at ...
10
votes
4
answers
53k
views
How to connect to Oracle DB from .NET?
When I open SQL Command Line, I write CONNECT username/password@[//]host[:port][/service_name] and it connects me to the database just fine. However, I'm unable to connect from a .NET project using a ...
10
votes
2
answers
4k
views
Entity Framework 6 Programmatically Connect to Postgres
I'm working on programmatically establishing a connection to PostgresSQL using Entity Framework 6. I have this class:
public class ClearspanDatabaseContext : DbContext
with this constructor:
public ...
10
votes
2
answers
10k
views
Retrieve and use Windows Azure's connection strings?
I've configured connection strings in Azure management portal Configure->Connection Strings (linked resources):
What are these connection strings useful for?
I tried deleting the conn. strings from ...
10
votes
1
answer
20k
views
How to read a connectionstring in .net 4.5
How do I read a value from the web.config file for a connectionstring in the 4.5 .net framework?
I'm using system.configuration which I have a reference to and a using statement, but the only thing ...
10
votes
2
answers
36k
views
What does "pooling=false" in a MySQL connection string mean? [closed]
What does pooling=false in a .NET connection-string for a MySQL database mean?
This is the complete connection string:
return new MySqlConnection("SERVER=localhost;DATABASE=myDataBase;USER=###;...
10
votes
2
answers
7k
views
Autogenerated default connection string vs. manually added one
Let's say I have got simple WPF application using Entity Framework Code First to create database, connect to it and display some data. From start I do not want to worry about connection strings so ...
10
votes
2
answers
49k
views
Calling a stored procedure with asp.net
If I have a connection string defined in my web.config file, how do I create a connection to the SQL db from C# code (sorry forgot to specify) and then call a stored procedure. I would then like to ...
10
votes
2
answers
29k
views
Using multiple connection strings
Info
I have multiple projects in my Solution, of which one is the DAL and the other is an ASP.NET MVC6 project.
Since the MVC6 project is also the startup project I need to add my connection string ...
10
votes
7
answers
42k
views
An error occurred while getting provider information from the database
Getting the error:
System.Data.ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect ...
10
votes
3
answers
5k
views
Single Connection String with Multiple Entity Framework Models?
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 ...
10
votes
3
answers
52k
views
Microsoft.ACE.OLEDB.12.0 CSV ConnectionString
I know questions this kind are asked from time to time but i can't find any satisfying solution.
How can I open a CSV-File using MS ACE OLEDB 12?
I try it with the following code.
DbConnection ...
10
votes
2
answers
9k
views
ASP.NET Core: Where to place Connection String for Production
ASP.Net Core, using version 5.0.100, and I am trying to publish my web application to a hosting provider. I am trying to figure out where to place my connection string. As of right now I have it ...
10
votes
3
answers
95k
views
How to get SID, Service Name and Port for Oracle database?
I have oracle database running on address xx.xx.xx.xx
I know login, password and initial catalog
I am trying to set up new connection in Oracle SQL Developer so I can access this database to take a ...
10
votes
1
answer
15k
views
Entity Framework cant use the DbContext, model being created
I am using EF 4.1, and I create a normal EF edmx file.
I generate it from a DB.
When it's been generated I rightclick and select add code generation item, to generate new classes, and use the ...
10
votes
2
answers
8k
views
Azure: Web.config Connection String' argument cannot be null or empty
When I try to publish an azure app I get this error.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4283,5): Error : The 'ibasis_Data_Transfer....
10
votes
3
answers
1k
views
Can't connect to SQL LocalDB from Windows Service, WPF app & SSMS work fine?
Having some trouble with a system I'm developing. The layout as far as this question is concerned is a WiX built msi installer which installs SQL LocalDB 2012, a WPF app, and a Windows Service. Both ...
10
votes
3
answers
3k
views
Can't connect to SQL Azure from app, but can from SSMS
I have a SQL Azure instance set up and can connect to it with no issue from SQL Server Management Studio. However when my app tries to connect, this error occurs:
A network-related or instance-...
9
votes
3
answers
18k
views
How to validate ConnectionString exists and if not do not throw error
The connection name 'MySqlServer' was not found in the applications configuration or the connection string is empty.
So, I have a page with a panel that will display when the connection in the web ...
9
votes
2
answers
9k
views
Using a separate file to maintain the connection string for entity framework
I have my connection string currently in my web.config file.
Is it possible to place it in a separate file and point entity framework to it.
9
votes
7
answers
13k
views
Storing connection strings in machine.config vs storing them in web.config
For a dedicated server, is it better to store the connection string in web.config or machine.config? what's the advantages and disadvantages of each approach?
Thanks
Edit: I'm concerned about ...
9
votes
3
answers
23k
views
C# connection string in web.config file
In my code behind page, how do I access the connection string which is stored in my web.config file?
9
votes
1
answer
3k
views
Using a LINQ Where query to get only some of the ConfigurationManager.ConnectionStrings
My goal is to use a LINQ Where query on the ConfigurationManager.ConnectionStrings collection in a console application (assume a fresh .NET 4.5 console application with a System.Configuration ...
9
votes
1
answer
9k
views
Secure ConnectionString in WinForm Applications
How Can I Secure my ConnectionString in WinForm Application?
9
votes
3
answers
30k
views
What is the jdbc connection string for h2 database?
I'm trying to connect to an h2 database on my local machine to create a sql DataSource object. I'm running windows and i'm having some issues defining the path to the data file in my projects app....
9
votes
3
answers
5k
views
How can I get the connection string for an SQL Express database listed in LINQPad?
Is there an easy way to get the connection string of a database listed in the connection window of LINQPad (other than using the object explorer of Visual Studio)?
9
votes
3
answers
83k
views
The right connection string for Remote SQL server for C#
I just want to know the right sql connection string for a remote sql server express edition.
This is what I got but I got some problems
SqlConnection cs = new SqlConnection(@"Data Source=(IP ...
9
votes
3
answers
21k
views
Entity Framework with Microsoft Access
I use .accdb file. I created class
using System.Data.Entity;
class MSADbContext:DbContext
{
public DbSet<Product> Products { get; set; }
}
and add connectionString
<...
9
votes
2
answers
13k
views
EntityFramework can't see ConnectionString in the App.config
I am studying Code First EntityFramework together with ASP.Net MVC 3.
At first my trivial EFDbContext class was placed in the WebUI mvc project in a Concrete folder.
public class EFDbContext : ...
9
votes
2
answers
26k
views
How to securely store a connection string in a WinForms application?
I need to know what is the common way to store a SQL server connection string for a WinForms application in VB.NET.
I have searched the net and I found answers to each of the following questions:
...
9
votes
2
answers
6k
views
Apostrophe (single quote) in connection string
I'm having a trouble with the ' character in a connection string. Entity Framework throws an exception saying:
Format of the initialization string does not conform to specification starting at ...
9
votes
6
answers
25k
views
'MultipleActiveResultsSets' Keyword Not Supported
I am trying to read from an SQL Server database which is hosted on MS Azure, through an ASP.NET WebForms website created in Visual Studio 2013.
I've stored the Connection String in Web.Config, and ...
9
votes
2
answers
13k
views
Modify web.config with powershell
I need to try to update a web.config file to change the IP address only of the web.config
I have included the section of code Im looking at for powershell to script the change.
<connectionStrings&...
9
votes
5
answers
5k
views
NLog with an Entity Framework connection string?
I'm trying to use the 'Database' NLog target and would like NLog to read my connection string to avoid having to set it twice in the same config file. The problem is I have an Entity Framework-style ...
9
votes
1
answer
7k
views
Is ConfigurationManage -> section.SectionInformation.ProtectSection() machine dependent?
in the code
Configuration config = ConfigurationManager.OpenExeConfiguration (Application.ExecutablePath);
ConnectionStringsSection section = config.GetSection("connectionStrings") as ...