Skip to main content

Questions tagged [connection-string]

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

connection-string
Filter by
Sorted by
Tagged with
14 votes
4 answers
19k views

Specifying Port With SqlConnectionStringBuilder?

I've ran into a snag. I have a need to specify the port number for my local installation of SQL Server 2008 R2. So far I've tried using the SqlConnectionStringBuilder with the data source set as .\...
David W's user avatar
  • 517
14 votes
2 answers
4k views

RSConfig generates a Dsn Connection String doesn't work

TL;DR. Repro steps, take a backup of your C:\Program Files\Microsoft SQL Server\MSRS13.SSRS\Reporting Services\ReportServer\RsReportServer.config Run this command to update the connection string ...
Jeremy Thompson's user avatar
13 votes
4 answers
21k views

Linq to Sql - Set connection string dynamically based on environment variable

I need to set my connection string for Linq to Sql based on an environment variable. I have a function which will return the connection string from the web.config based on the environment variable, ...
Ryan's user avatar
  • 17.9k
13 votes
2 answers
2k views

Where does this permanent SQLExpress connectionstring come from (not web.config)?

Today I noticed that in my ConfigurationManager.ConnectionStrings the very first instance is .\SQLEXPRESS. I remembered explicitly removing this entry from my web.config so I checked again, but didn't ...
Boris Callens's user avatar
13 votes
2 answers
13k views

Can't access the configuration manager from my solution

I have a three tier set-up. Someone suggested I should get the ConnectionString from the Web.Config file and I've got it set up like this: Now I'm trying to access the ConnectionString from my DAL ...
Sergio Tapia's user avatar
  • 40.8k
13 votes
5 answers
128k views

How to increase time in web.config for executing sql query

When I am running a query in web application, I'm getting a null value. Same query directly in SQL Management Studio returns results. I think that the problem is a timeout. How can I increase the ...
Jui Test's user avatar
  • 2,399
13 votes
7 answers
34k views

How to connect to mysql from C# over SSH

How can I connect to a mysql database trough C#, This is my connection string now: connectionString="server=localhost;port=3306;user id=root;Password=*****;database=Data" providerName="MySql.Data....
user123_456's user avatar
  • 5,755
13 votes
4 answers
10k views

winforms connection properties dialog for configuration string

Is there a way to display the connection properties dialog for connection string browsing(for database) in run time? As I want the user to be able to connect to various database using the GUI. The ...
Thunder's user avatar
  • 10.7k
13 votes
4 answers
20k views

Reading connection string from external config file

I have created a console application and an app.config file and Connections.config file. The app.config file has a connectionstring property source pointing to the Connections.config When I tried to ...
PSR's user avatar
  • 893
13 votes
5 answers
6k views

Connection Strings are replaced when performing Azure Web Site staging Swap

(1) we have a web application running on Azure Web Site using Sql Server (Web Edition). The application includes two connection strings: DefaultConnection - normal connection string, in the form of ...
yarg's user avatar
  • 709
13 votes
3 answers
73k views

What is a TNS:listener in the Context of Oracle?

Borderline ServerFault question, but figured I'd try here first since I've had luck with Oracle questions in the past. I'm trying to connect to an oracle database from PHP, and I'm getting the ...
Alana Storm's user avatar
13 votes
2 answers
32k views

Where to look for UserId and Password for Azure SQL Server Connection

I have ASP.NET MVC app and I am trying to connect to Azure SQL database migrated on Azure. I need to set my connection string in web.config and I have no idea where to look for the user id and ...
Bart's user avatar
  • 177
13 votes
3 answers
4k views

Where to put the database sensitive information [duplicate]

Possible Duplicate: How to secure database passwords in PHP? Recently I was given a website project which was supposed to be done in PHP but I don't have much experience in PHP. Anyway, it is up ...
dragon66's user avatar
  • 2,675
13 votes
2 answers
5k views

Inject custom connection string into Entity Framework's DbContext

I want to inject a custom connection string into my EF context instead of using the connection string in my web.config. The idea is to move all database related logic off of my MVC project into a ...
Jan's user avatar
  • 2,759
13 votes
2 answers
31k views

Readonly connection string to an access database

I'm trying to connect to an Access database file using a System.Data.OleDb.OleDbConnection. I need to connect in readonly mode because another application uses it at the same time. I can connect to ...
Smiffy's user avatar
  • 371
13 votes
3 answers
2k views

What is the best way to centralize and secure connection strings?

What is the best way to centralize and secure the connections strings used by applications? In my environment we have many internal applications. Each application requires one or more connection ...
Stimy's user avatar
  • 1,511
12 votes
3 answers
15k views

Get multiple connection strings from web.config

How to get all the connection strings's names from the web.config via code in C#? I tried this: System.Configuration.Configuration webConfig = System.Web.Configuration.WebConfigurationManager....
petko_stankoski's user avatar
12 votes
5 answers
16k views

Overriding code-generated DbContext constructor

I'm sure I've done this before at some stage, but I can't figure out how to now! My scenario: // This is generated from EDMX public partial class HOLDbEntities : DbContext { public HOLDbEntities()...
Chris Dixon's user avatar
  • 9,167
12 votes
4 answers
93k views

Excel VBA - connect to sql with a trusted connection (no uid/pwd)

Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/...
notnot's user avatar
  • 4,612
12 votes
5 answers
19k views

Using Hangfire, connection string given in Startup.cs throws Cannot attach file as database error

I'm utilizing Hangfire in my ASP .Net MVC Web App, it had installed successfully. I'd like to use the same LocalDb to store queued jobs for Hangfire to dequeue and process as I've used to stored data. ...
jerryh91's user avatar
  • 1,795
12 votes
4 answers
44k views

Getting sql connection string from web.config file

I am learning to write into a database from a textbox with the click of a button. I have specified the connection string to my NorthWind database in my web.config file. However I am not able to access ...
A_AR's user avatar
  • 508
12 votes
11 answers
16k views

The web publishing extension is not installed which is required to publish

I was tring to deploy an ASP.NET Web Application to a Windows Azure Web Site by following the tutorial through this link: https://www.windowsazure.com/en-us/develop/net/tutorials/get-started/ After ...
Chong Wang's user avatar
12 votes
3 answers
6k views

Stop LINQ to SQL dbml from updating connection string when I drag tables into the dbml file

Every time I drag a modified table into my dbml, VS2010 wants me to update the connection string even though I have created a data connection with the exact same information. Every time this happens ...
Chris - Haddox Technologies's user avatar
12 votes
4 answers
10k views

What is the correct syntax for a Flyway connection string to SQL Server?

Running SQL Server 2012 Express on a remote machine, trying to get Flyway up and running. I have a database on pcesqldev.pce.local called Hawk (dbo.Hawk, if that matters) that I want to connect to, ...
DaveN59's user avatar
  • 3,708
12 votes
1 answer
19k views

How to add entity framework 6 provider in code?

I use Entity Framework 6 in a C# application and it works perfectly. When creating the Model, the app.config is generated with all the necessary configuration. Now I don't like having stuff in the app....
Flave's user avatar
  • 121
12 votes
3 answers
18k views

With System.Data.SQLite how do you specify a database file in the connect string using a relative path

Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick ...
minty's user avatar
  • 22.4k
12 votes
2 answers
1k views

Accessing the attributes of a file connection created via file()

I'm creating a file connection via path <- file("C:/test.txt") and when printing the object associated to the connection I can see the connection's "attributes": > path description ...
Rappster's user avatar
  • 13k
12 votes
3 answers
7k views

SQL Server: Modifying the "Application Name" property for auditing purposes

As we do not implement the users of our applications as users in SQL server, when the application server connects to a database each application always uses the same credentials to attach to each ...
Chris Simpson's user avatar
12 votes
3 answers
16k views

How do we alias a Sql Server instance name used in a Connection String .config?

I have two development teams, that come from different groups. Group A develops against a local default instance of Sql Server 2008 R2; Group B develops against a local named instance of Sql ...
Ralph Shillington's user avatar
12 votes
2 answers
91k views

SQL Server Error "Named Pipes Provider: Could not open a connection to SQL Server [53]"

I used to have a desktop application pointing to a Sybase database through an .ini file that had this connection string: CONNECTION_NAME = "DSN="Dna_Name";UID="User";PWD="Password"" It worked ...
G21's user avatar
  • 1,317
12 votes
1 answer
7k views

APP vs Application Name in Connection String

What's the differences between the APP attribute and Application Name attributes in the connection string? Is one just an alias to another one? I can't seem to find any documentations about it. Also, ...
StarCub's user avatar
  • 4,231
12 votes
4 answers
27k views

Error occurred during the pre-login handshake

Please read in the entirety before marking this as duplicate. In a project that I am debugging I receive a SqlException saying the following: Additional information: A connection was successfully ...
CodeWarrior's user avatar
  • 7,430
12 votes
3 answers
74k views

Sql developer custom connection string

How to use custom connection string in Oracle sql developer to connect? jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=147.22.109.218)(port=1521))(ADDRESS=(PROTOCOL=TCP) (...
user1570345's user avatar
12 votes
2 answers
51k views

How to find connection string from a phpMyAdmin database?

I want to connect from java, to a database which i am currently managing from phpMyAdmin. I do not own the server which the database runs. however, i want to find the connection string of that ...
Anonymous's user avatar
  • 193
11 votes
1 answer
6k views

Separate ConnectionStrings and mailSettings from web.config? Possible?

Is it possible to separate ConnectionStrings and mailSettings from web.config? Devel environment has different IP addresses for connectionstrings and smtp mails because of development and testing. We ...
feronovak's user avatar
  • 2,687
11 votes
3 answers
31k views

How do I solve "Keyword not supported: 'metadata' "?

I can't connect to SQL Server and connection string of my project is: <add name="Teleport_DEVEntities" connectionString="metadata=res://*/Data.Model.AdvertisingModel.csdl|res://*/Data.Model....
Batuhan Avlayan's user avatar
11 votes
4 answers
14k views

ConnectionStrings in app.config with characters that the .config file doesn't like

I've looked for the answer and can't find it. It's got to be something obvious and I'm just missing it. We have a connection string issue in an app.config file. It uses SQL Server authentication, ...
David's user avatar
  • 73.3k
11 votes
4 answers
40k views

pyodbc + MySQL + Windows: Data source name not found and no default driver specified

I am trying to connect to MySQL 5.6 on a Windows Server 2008 R2 localhost with pyodbc. I used the full installation for the MySQL instance on the localhost, including the ODBC connector. I have it ...
sct.chang's user avatar
  • 121
11 votes
2 answers
20k views

how to change connection string initial catalog

I have a connection string in web config file. I used this connection with name in all my files. connection string is like <add name="connectionname" connectionString="Data Source=DEVELOPER1;...
Vivek Parikh's user avatar
11 votes
2 answers
7k views

Docker SQL-Server login problem: AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback

I'm working on a Docker related application, written in C#, based on Entity Framework. One of the Docker containers, is the ms-sql-server, which is used for database access. In order to access the SQL-...
Dominique's user avatar
  • 17.2k
11 votes
2 answers
26k views

How to add Azure SQL Server connection string to app.config in Windows Forms?

I'm trying to add an Azure SQL Server connection string into my app.config file, but there are red underlines all over the connection string when I try to copy and paste it from Azure. I'm using ...
mabel's user avatar
  • 121
11 votes
9 answers
33k views

asp.net mvc Invalid value for key 'attachdbfilename'

I am currently reading Manning's "ASP.NET MVC 4 in Action" book and trying to get the first example to work. Within my test application, I built a simple Model and created some Views. I then ...
Bick's user avatar
  • 18.3k
11 votes
3 answers
34k views

OracleConnection.Open is throwing ORA-12541 TNS no listener

So I am connecting to an external server through C#. I just installed Oracle 11g client on my machine from here: http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html (255MB ...
RG-3's user avatar
  • 6,148
11 votes
3 answers
27k views

Changing dataset connection string at runtime

I have a c# generated dataset. How can I change the connection string so I can use the dataset with another (identically structured yet differently populated) database? This has to occur at runtime ...
DanDan's user avatar
  • 10.5k
11 votes
2 answers
45k views

How do I connect to SQLite db file from c#?

I am trying to connect to a sqllite db from with a c# application. I have never worked with SQLLite before. var connectionString = @"data source='C:\TestData\StressData.s3db'"; connection ...
Nick's user avatar
  • 19.5k
11 votes
5 answers
123k views

What is the default username and password of my SQL Server Express?

It installed automatically with Visual Studio 2010 Ultimate. I didn't create any users for the server or ANYTHING. I'm using: string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;...
Sergio Tapia's user avatar
  • 40.8k
11 votes
3 answers
8k views

What's best way to secure a database connection string?

I am writing a set of database-driven applications in PHP. These applications will run on a Linux server as its own user. Other users will likely be on the system at times, but have very controlled ...
Chris Kloberdanz's user avatar
11 votes
5 answers
14k views

How to Access a connectionstring from another project

I got two project in my solution in Visual Studio 2010. Project 1 contains an app.config with a ConnectionString. How can I access that ConnectionString from Project 2? Since they are both using the ...
gulbaek's user avatar
  • 2,521
11 votes
4 answers
2k views

How to connect with System.Data.OracleClient to oracle db with windows authentication?

With Oracle SQL Developer I can put / -character to Username and leave password empty and I get connected. I have OP$MYWINDOWSUSERNAME user created in database. EDIT: SQL Developer does not work if I ...
char m's user avatar
  • 8,114
11 votes
4 answers
15k views

Securely encrypting / decrypting appsettings.json on server

How do I protect the encryption key used to encrypt sensitive data in my web application's appsettings.json? I would like to protect sensitive data in my web application's config. In ASP.NET MVC4 ...
Ergwun's user avatar
  • 12.8k

1 2 3
4
5
93