All Questions
Tagged with connection-string visual-studio
87
questions
27
votes
6
answers
16k
views
VS2010 web deploy the connection string argument cannot be null or empty
Having problems deploying a website to an windows 2008 r2 server running IIS7. I have previously deployed another site to this server. The web deploy is connecting and copying my files to server but I ...
23
votes
4
answers
8k
views
web.config transform - delete comments from connectionstring section
I store several different connection strings in my web.config for development and testing. All but one is commented out so I can change info as needed.
When I publish, I would like to replace ...
6
votes
2
answers
2k
views
How do I create a Solution Wide Connection String
Does anyone know if it is possible to create a single connection string that will be accessible to all the projects in a solution (we have about 6).
I can create a text file with this information, ...
4
votes
4
answers
17k
views
"Unrecognized configuration section connectionStrings."
I had been working on a project in VS2005 that utilized a local connection to an Access DB.
In the past week, I installed .NET framework 3.5 for use w/ a different project as well as VS6.
I went ...
4
votes
2
answers
2k
views
Can't connect to local SQL Server DB with connection string, but VS can
I'm trying to connect to a local Sql Server 2012 database instance trough Visual Studio 15 using connection string. While I've been able to connect to the DB through the Visual Studio SQL Server ...
3
votes
2
answers
22k
views
System.Configuration.ConfigurationManager.ConnectionStrings has no connection string configured
Whenever I try to run anything in my C# code I get the following error:
System.InvalidOperationException was unhandled by user code
Message=No connection string configured
and it happens in the ...
3
votes
1
answer
3k
views
Reference connection strings in separate config file
I would like to move my connection strings from my web.config file to a file called ConnectionStrings.config, both files are in the root of my web application.
Web.Config
<configuration>
&...
3
votes
1
answer
7k
views
Visual Studio Project: Properties/Settings.settings Missing
I've checked out a solution from source control and opened it in Visual Studio. My assumption is that this solution compiled at one time (two years ago) and was deployed.
There is a project that ...
3
votes
3
answers
1k
views
Unsure how to set C# Connection string depending on solution configuration
I'm trying to figure out how to use Solution Configuration Management in Visual Studio to set a MySQL Connection string depending on what build configuration but am fairly new to this.
I've found ...
3
votes
1
answer
2k
views
How to deploy an SQL Compact Edition database file (.sdf) in the AppData folder? Connection string?
I'm planning to deploy my DB file in the Users\CurrentUserName\AppData folder, because default User Account Control settings restrict write access to the Program Files directory where my program is ...
2
votes
4
answers
4k
views
How to run desktop application with its Sql Server database on a machine that have not SQL server installed
I have already finished a desktop application using Visual Studio 2010 and SQL Server 2008.
it's working perfectly on my machine (i have a SQL Server 2008 and 2005 ).
the database is local and ...
2
votes
1
answer
3k
views
Why is the scope of a ConnectionString setting always forced to "Application"?
I'm probably not the first one facing this problem, but I couldn't find a proper answer anywhere.
I have a Windows Forms application that uses a strongly-typed DataSet. The designer uses a connection ...
2
votes
2
answers
4k
views
What is the connection string for SQL Server running on Mac Docker in ASP.NET Core?
I'm trying to finish the ASP.NET CORE tutorial on Pluralsight on a MAC. I'm running MSSQL server using Docker and its seems to work (i have the sql database up and running
as shown here)
The second ...
2
votes
2
answers
3k
views
Visual Studio Express can't change data source
I am trying to add a SQL Server data source to a C# console app.
When I try and add a new connection to my .dbml file the only Data Source available is Microsoft SQL Server Database File (sqlclient) ...
2
votes
3
answers
741
views
slow cheetah xml transformation tool is overwritting the original config
I am using slow cheetah web config transformation tool for transforming connection-string.config according to deployment settings. Problem is after transformation it overwrites the original ...
2
votes
2
answers
1k
views
How to verify and manage the app.config file in Visual Studio?
I am making a WPF application in Visual Studio 2015. The database layer is using Entity Framework, which generated a connection string in the app.config file. The database connection works and the app ...
1
vote
2
answers
24k
views
'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll, System.Configure already included
I have a Windows Form application in VS 2013 and I'm trying to establish a database connection. Every time I run the program, however, I receive the following error:
An unhandled exception of '...
1
vote
2
answers
669
views
Connection strings and configuration manager
I have a project by someone else and there is this line of code:
ConnectionStringSettings myConnectionStringSetting = ConfigurationManager.ConnectionStrings[0];
which for some reason returns this:
...
1
vote
3
answers
139
views
Problem with connection string using
I have an ASP.NET project which gives me the following exception if I try to run it
Where should I "call" it before I can use it ?
There is no global.asax in my solution
1
vote
1
answer
7k
views
Localdb in Visual Studio 2015 error 52 (SQL Server)
I programmed an application with an attached .mdf database file that works fine on my computer. But on another computer (client PC) I get this error message :
A network-related or instance-specific ...
1
vote
1
answer
988
views
How do I effectively store a connection string in machine.config only?
We are moving to an environment with multiple engines of SQL Server running on the same server (a test engine and a production engine). We also have separate test and production web servers, and ...
1
vote
1
answer
624
views
Package Manager Console fails to read ConnectionStrings when running Add-Migration
Running Add-Migration on the Package Manager Console inside Visual Studio 2019 throws a NullReferenceException when trying to access the connectionString key with ConfigurationManager....
1
vote
1
answer
343
views
Can connect to the remote SQL server, but connection string test fails
I have my application and SQL database on two different PCs in the same LAN.
I use Visual Studio 2017 community version.
I can connect to the database through SQL Server Object Explorer, in VS17, but ...
1
vote
0
answers
2k
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 ...
1
vote
0
answers
482
views
How to create a C# program setup wizard, containing a SQL Server connected database?
I am developing a C# Windows Forms project in Visual Studio which contains a SQL Server database.
Everything is working great I have connection string saved in Properties.Settings... but when I ...
1
vote
0
answers
57
views
Visual Basic, Read database(Ms Access) directly from it's project map instead from C:drive
I want to put the database with the projects file, meaning
location = "\Database.mdb'.
However I'm getting error
"Could not find file 'C:\Database.mdb'..
How do I make the project look into ...
1
vote
1
answer
571
views
“The ConnectionString property has not been initialized” error
I am new at c# and I research some project on internet. I found a project but when I start the project I get
"The ConnectionString property has not been initialized."
How can I fix it? Here is ...
1
vote
2
answers
1k
views
how to Connect a C# project with database on the local network to edit and view?
I have a Data Entry C# Project,
I want to make it run on three computers on the same network and make their database on the network so everyone can see the edit of the others on the file i am using ...
1
vote
1
answer
2k
views
connection provider to read xls files
I used the below connection string to read xlsx files. Its working fine.
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\"Excel 8.0;HDR=NO;\"";
...
1
vote
1
answer
587
views
Better way to manage connection strings in visual studio?
I have multiple projects which connects to the same database through the connection-string, and they all have the same app.config data.
When, or if, I change my database I'm going to have to update ...
1
vote
0
answers
572
views
Visual Studio suddenly stopped accessing database after changing connection string
I had a running system on Visual Studio 2008 and it always managed to access the database successfully. I am using SQL Express 2005
I had this string:
Driver={SQL Server}; Server = MyName-PC ; ...
0
votes
2
answers
2k
views
How to place the exe.config file in the AppData in the installation?
I have developed a Windows Form Program in C# with Visual Stuido 2013. When it is installed, I would like the exe.config file to be in the AppData path. Becuase sometimes the program will have to read ...
0
votes
3
answers
2k
views
Problem In Open Or Use master.mdf database in C#
I define Sql_Cmd And Other sql variable that need before
and Now write this code:
string strConnection2 = "Data Source=.\\sqlexpress;AttachDbFilename=master.mdf;Integrated Security=True;Connect ...
0
votes
1
answer
253
views
VS C# Sql Client unable to connect to SQL Server, uses Windows auth instead of SQL Server auth
I have two desktop clients with VS 2017. I inherited a C# .NET app that connects to a SQL Server in the next room. We generally use SQL Server authentication (as opposed to Windows authentication) ...
0
votes
3
answers
1k
views
Cannot connect to SQL Server using Named Pipes through .NET application
First of all, I am trying to make this work because the "initial connection" of my Windows Forms application (run from Windows 10) to my SQL Server 2012 VM is taking too long (once connected ...
0
votes
2
answers
2k
views
Where Does Visual Studio Store the Connection String
The problem is that the table adapter keeps referencing a connection string that I have not set up for it. When I go to each data table in the DataSet Designer, the connect says "MyConnectionString(...
0
votes
1
answer
163
views
error connecting to sql server compact file in VS2012
I use following connection string for connecting to my SQL Server Compact database (.SDF file) in a VS 2012 (.NET 4) Win form app:
SqlConnection SQLConnection = new SqlConnection("Data Source=d:\\...
0
votes
2
answers
327
views
Getting started with VB.NET Databases
I'm having trouble figuring out databases in VB.NET. (VS 2008)
What control(s) do I need to use and how do I use them? I am ,looking for tutorials and sample code too.
I'm working on a trivia game ...
0
votes
2
answers
73
views
How to add two connection strings in Visual Studio?
How can I write for 2 database connection string to app.config in Visual Studio?
Fox example
Data Source=devsql;Initial Catalog=Pool;Max Pool Size=1000;MultipleActiveResultSets=True
I want to add ...
0
votes
2
answers
157
views
How to implement a service in visual studio when host of sql server and wcf are different
Connection string syntax in web config when connecting to a remote host sql server.
How to write correct connection string if your sql server host is www.xyz.com and we have a sql server instance ...
0
votes
1
answer
371
views
How to remove hidden connection strings
I have a vs winform application which gets its datasources from a configuration file (app.config). I had connections to several databases. I have now removed some of them so that I am remaining with ...
0
votes
1
answer
1k
views
importing Xlsx file into sql database
I want to import an XLSX file into sql database. If I use this connection string
string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""...
0
votes
1
answer
553
views
ASP.NET Entity Framework code-first connection string for SQL Server mdf file, where is it and how do I change it?
I am launching my asp.net application and am having issues with some databases that were created locally. I need to change their connection string for the program to point to my new online SQL Server ...
0
votes
1
answer
38
views
Problematic connectionstring, state closes and opens
I have a connectionstring in my xamarin android project:
`<add name="NewsPushEntities" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string="Data ...
0
votes
1
answer
309
views
Relative ConnectionString Database (visual studio) Vb.net
I created a database with VS2015 express when I use this connecion string :
Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\example\documents\visual studio 2015\Projects\materials ...
0
votes
3
answers
2k
views
Winforms debug/release production/dev connection string app.config
I always forget to change connection string when publishing Winforms application.
I'm using EF6 and .net framework 4.5.
In App.config
<connectionStrings>
<add name="NarudzbeEntities" ...
0
votes
1
answer
1k
views
ASP.Net Unable to find .Net Framework Provider
During the process of uploading a site to a Godaddy server, the datagrid using MySql is causing problems. The errors are outputted below along with the web config. The issue seems to be that the ...
0
votes
4
answers
7k
views
Connect to remote SQL Server 2008 on Visual Studio 2010
I created a local MSSQL database with my ASP.NET project.
Now I want to connect to my database hosted in www.abc.com
What should I put in the connectionString ?
0
votes
1
answer
258
views
TableAdapter Provider uses Microsoft.Data.SqlClient regardless of ProviderName being set
I am trying to create a new TableAdapter using the connectionstring added in Web.config, and to minimize any chance of incompatibilities with existing libraries, I want my provider to be System.Data....
0
votes
0
answers
150
views
Unable to open mdf file | Local SQL Server database
I'm using Visual Studio 2022. I have created a WPF program which has access to a local database with the following relative connection string
"Data Source = (LocalDB)\\MSSQLLocalDB;...