Skip to main content

All Questions

Filter by
Sorted by
Tagged with
640 votes
9 answers
851k views

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 ...
JD.'s user avatar
  • 15.4k
395 votes
10 answers
423k views

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 ...
Halcyon's user avatar
  • 14.9k
212 votes
5 answers
687k views

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 <connectionStrings> <add name="NorthwindContex" ...
MDC's user avatar
  • 2,121
158 votes
4 answers
69k views

"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; ...
nawfal's user avatar
  • 72.3k
126 votes
10 answers
1.1m views

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 ...
Roshan's user avatar
  • 3,334
120 votes
16 answers
470k views

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 ...
keram's user avatar
  • 2,381
105 votes
3 answers
216k views

What is the point of "Initial Catalog" in a SQL Server connection string?

Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial ...
Ryan Lundy's user avatar
  • 208k
102 votes
4 answers
46k views

What is the difference between Trusted_Connection and Integrated Security in a connection string?

I'm curious what the difference between the token "Trusted_Connection" and "Integrated Security" in SQL Server connection strings (I believe other databases/drivers don't support these). I understand ...
Peter Oehlert's user avatar
70 votes
8 answers
209k views

What is the connection string for localdb for version 11

I'm trying to do the Code First Walkthrough of the entity framework ( http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-code-first-walkthrough.aspx ). I have the latest SQL Server Express and ...
Bill Nielsen's user avatar
60 votes
5 answers
110k views

Possible to set default schema from connection string?

With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It'd be a lot easier if we didn't have to manually set the schema with SQL code.
Earlz's user avatar
  • 63.2k
54 votes
1 answer
260k views

A network-related or instance-specific error occurred while establishing a connection to SQL Server [closed]

I deployed my asp.net web application on somee.com, whenever I login into this site (ipc.somee.com) it gives me a network related error like: A network-related or instance-specific error occurred ...
Suresh's user avatar
  • 609
51 votes
7 answers
275k views

Connect to SQL Server Database from PowerShell

I have looked around online for a while now and found many similar problems but for some reason I can't seem to get this working. I am just trying to connect to a SQL server database and output the ...
Johnathan's user avatar
  • 919
34 votes
2 answers
15k views

What does App=EntityFramework do in Sql connection string?

I have 2 connection strings - 1 local and 1 for my main production server. Entity Framework added App=EntityFramework to my local string when I installed it (4.1) - I'm now on 4.3. What does this do - ...
dotnetnoob's user avatar
  • 11.2k
34 votes
3 answers
12k views

Is there a difference between (local), '.' and localhost?

I've used all three of these when making local programmatic connections to databases. Is there any real difference between them?
Chris Sutton's user avatar
  • 2,771
22 votes
8 answers
28k views

Display a ConnectionString dialog

I'm trying to create a program in C# that should be able to create, backup and restore a SQL Server database. For this, the user needs to be able to setup a connection string to the desired SQL ...
Christian Tang's user avatar
22 votes
1 answer
19k views

Change Application Name in Sql Server Profiler

When profiling a .Net Application in SQL Server Profiler the default Application Name is taken from the Data Provider. How can I change this to my own Application Name?
Daniel Stackenland's user avatar
18 votes
1 answer
42k views

Building a connection URL for mssql+pyodbc with sqlalchemy.engine.url.URL

The problem... I am trying to connect to a MSSql server via SQLAlchemy. Here is my code with fake credentials (not my real credentials obviously). The code... credentials = { 'username' : '...
Clay's user avatar
  • 637
18 votes
1 answer
1k views

ODBC problems in SQL 2000 --> 2005 Upgrade

This wiki post outlines both a problem and a solution. I wanted to post this for others that may be having similar problems, as I couldn't find anything specifically to solve this problem elsewhere. ...
17 votes
8 answers
16k views

What is the best way to store connection string in .NET DLLs?

The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and ...
proudgeekdad's user avatar
  • 3,425
16 votes
1 answer
10k views

ELMAH Logging in SQL Server

I am having an ELMAH problem. I think it is the connection string but can't figure out why. It is emailing me errors no problem, just not logging them into sql. If the problem is permissions, how ...
Ethan Schofer's user avatar
15 votes
6 answers
55k views

Multiple SQL Server connection strings in app.config file

I'm interested in displaying in a Windows Forms app a list of N radio buttons for the user to choose a target database server. I would like to add the SQL Server connection strings in the app.config ...
Benjamin Ortuzar's user avatar
15 votes
1 answer
21k views

Force the TCP/IP protocol in connection string

I have a database driven website written in asp.net. I'd like to modify the connection string to force protocol TCP. Please advise. <add name="TESTConnectionString" connectionString=...
PW2's user avatar
  • 791
15 votes
3 answers
15k views

the best way to connect sql server (Windows authentication vs SQL Server authentication) for asp.net app

I have a database and a site having forms authentication. It is working fine with VS2008. This time, I am using "Trusted_connection =True". But when it is opened from outside or directly from browser ...
Brij's user avatar
  • 6,124
14 votes
1 answer
9k views

Multipleactiveresultsets in Entity Framework 4.1 Code First

This is my first EF project so bear with me please. When updating an entity such as Department, you pull it from the context, update its values and call context.SaveChanges. However, if you update ...
Raheel Khan's user avatar
  • 14.4k
14 votes
8 answers
40k views

error occurred while establishing a connection to SQL Server

If I have my connection string in the web.config like this (added line feeds for better readability): <add name="conn" connectionString="Data Source=(localdb)\v11.0; Initial Catalog=MyDB; ...
HMR's user avatar
  • 38.8k
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
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
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
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
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
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
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
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 ->...
товіаѕ's user avatar
  • 3,144
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=...
John's user avatar
  • 874
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 ...
Yuriy's user avatar
  • 103
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 ...
onit's user avatar
  • 6,356
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 ...
Jose Garcia's user avatar
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 ...
hcp's user avatar
  • 486
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 ...
Lucas Juan's user avatar
9 votes
3 answers
68k views

Cannot connect to database using localhost\sqlserver

I know we should be aware of such phrases but all of a sudden all my connections to localhost\sqlexpress stopped working. As .\sqlexpress and (local)\sqlexpress work, this wouldn't be a big deal if ...
Wullie's user avatar
  • 155
9 votes
1 answer
3k views

why contained database user needs Persist Security Info=True

I have a database where I created a contained user and I needed to connect to my web app using that user. I have always been able to connect to the web app with a standard user having Persist Security ...
monica's user avatar
  • 482
9 votes
2 answers
110k views

How to fix "'ServerVersion' threw an exception of type 'System.InvalidOperationException'"? [duplicate]

I have got a local SQL Server DB, up and running, and I am trying to connect to it in a seemingly failproof way: new SqlConnection(@"Server=(localdb)\v12.0;Integrated Security=true;Database=MyDBName;...
Yulia V's user avatar
  • 3,549
8 votes
5 answers
3k views

Prompt for Database Connection String

I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows ...
Brian's user avatar
  • 37.9k
8 votes
3 answers
4k views

.NET 4: How to configure EDMX file in other assembly in Web.Config

I have a problem with configuring an EDMX file that lives in an other assembly than by web project. My project looks somewhat like this: Project 1 --> Database.edmx --> App.Config Project 2 --&...
Erwin's user avatar
  • 1,492
7 votes
2 answers
14k views

How to set "Application Name" in ADODB connection string

In .NET I simply use Application Name = MyApp inside the connection string, but when using ADO connection through VBA the Activity Monitor of the SQL Server Management Studio always shows Microsoft ...
SysDragon's user avatar
  • 9,848
7 votes
2 answers
7k views

How can I create valid connection string by using shared memory protocol to connect a named instance of sql server?

How can I create a valid connection string by using shared memory protocol to connect a named instance of sql server while the sql server browser is disabled?
Rajesh's user avatar
  • 6,499
7 votes
2 answers
9k views

Sql difference between localhost and (LocalDb)/MSSQLLocalDB

I noticed I used a connection string to migrate an Identity Database. No matter what I did I looked and looked but I couldn't find the database. So I re-evaluated my connection strings and noticed ...
johnny 5's user avatar
  • 20.7k

1
2 3 4 5
18