Questions tagged [connection-string]

A string containing information necessary for connecting to a service, usually database.

Connection string is a string with information sufficient, either alone or together with some other information (e.g.credential) for connecting to a service.

It is often used for connecting to a database, via JDBC or ODBC.

Synonyms: connection URL

Links for further reading:
MySQL
.NET System.Data namespace

4571 questions
626
votes
9 answers

What is the difference between Integrated Security = True and Integrated Security = SSPI?

I have two apps that use Integrated Security. One assigns Integrated Security = true in the connection string, and the other sets Integrated Security = SSPI. What is the difference between SSPI and true in the context of Integrated Security?
JD.
  • 15,171
  • 21
  • 86
  • 159
439
votes
22 answers

Get connection string from App.config

var connection = ConnectionFactory.GetConnection( ConfigurationManager.ConnectionStrings["Test"] .ConnectionString, DataBaseProvider); And this is my App.config:
Moham ad Jafari
  • 4,399
  • 2
  • 15
  • 3
389
votes
11 answers

Entity Framework Timeouts

I am getting timeouts using the Entity Framework (EF) when using a function import that takes over 30 seconds to complete. I tried the following and have not been able to resolve this issue: I added Default Command Timeout=300000 to the connection…
Halcyon
  • 14,631
  • 17
  • 68
  • 99
295
votes
8 answers

How to connect to Oracle using Service Name instead of SID

I have a Java application that uses JDBC (via JPA) that was connecting to a development database using hostname, port and Oracle SID, like this: jdbc:oracle:thin:@oracle.hostserver1.mydomain.ca:1521:XYZ XYZ was the Oracle SID. Now I need to connect…
Jim Tough
  • 14,843
  • 23
  • 75
  • 96
274
votes
12 answers

Read connection string from web.config

How can I read a connection string from a web.config file into a public class contained within a class library? I've tried: WebConfigurationManager ConfigurationManager But these classes are not recognized within my class library.
chamara
  • 12,649
  • 32
  • 134
  • 210
203
votes
5 answers

Connection string using Windows Authentication

I am creating a website, but in the database I use windows authentication. I know that you use this for SQL authentication
MDC
  • 2,031
  • 2
  • 13
  • 3
172
votes
15 answers

How to read connection string in .NET Core?

I want to read just a connection string from a configuration file and for this add a file with the name "appsettings.json" to my project and add this content on it: { "ConnectionStrings": { "DefaultConnection":…
motevalizadeh
  • 5,244
  • 14
  • 61
  • 108
171
votes
6 answers

Keyword not supported: "data source" initializing Entity Framework Context

I'm initializing Entity Framework Object context, and this gives me the keyword not supported error: metadata=res://*/MainDB.csdl|res://*/MainDB.ssdl|res://*/MainDB.msl;provider=System.Data.SqlClient;provider connection string="Data…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
150
votes
4 answers

"Server" vs "Data Source" in connection string

I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works: Data Source=(localdb)\v11.0;Integrated Security=true; and Server=(localdb)\v11.0;Integrated…
nawfal
  • 70,104
  • 56
  • 326
  • 368
128
votes
14 answers

What is the MySQL JDBC driver connection string?

I am new to JDBC and I am trying to make a connection to a MySQL database. I am using Connector/J driver, but I cant find the JDBC connection string for my Class.forName() method.
ravi kumar
127
votes
5 answers

How should I edit an Entity Framework connection string?

I recently had to edit my app.config file to change the connection string for an Entity Framework data model (.edmx file). But I'd like to know: Is there a way to edit the EF connection string using the designer? The original connection string is…
121
votes
10 answers

How can I set an SQL Server connection string?

I'm developing a simple C# application, and I'd like to know this: When I connect my application to SQL Server on my PC, I know the connection string (server name, password, etc.), but when I connect it to another PC, the SQL Server connection…
Roshan
  • 3,236
  • 10
  • 41
  • 63
116
votes
16 answers

How to find SQL Server running port?

Yes I read this How to find the port for MS SQL Server 2008? no luck. telnet 1433 returns connection failed, so I must specify other port. I tried to use netstat -abn but I don't see sqlservr.exe or something similar on this list. Why it so…
keram
  • 2,321
  • 4
  • 24
  • 29
114
votes
2 answers

How to use pg_dump with a connection uri / url?

I can invoke psql like this: psql postgres://... How can I use pg_dump with a connection string in the format postgres://...? Would be more convenient than breaking URI's into host, post, username, password. Is there syntax for this?
Tronathan
  • 6,473
  • 5
  • 22
  • 24
103
votes
13 answers

Get ConnectionString from appsettings.json instead of being hardcoded in .NET Core 2.0 App

I have the following class in NET Core2.0 App. // required when local database does not exist or was deleted public class ToDoContextFactory : IDesignTimeDbContextFactory { public AppContext CreateDbContext(string[] args) { …
borisdj
  • 2,201
  • 3
  • 24
  • 31
1
2 3
99 100