Click here to Skip to main content
15,900,378 members
Everything / Connectionstring

Connectionstring

connectionstring

Great Reads

by #realJSOP
This library is intended for use in a multi-environment system, but it certainly be used under less stringent environmental confines, even down to a single desktop machine taht needs to connect to a single database server.
by ASP.NET Community
In my case, I use  a FileUpload Control(Id:->FileUpload1), an ImageButton(ImageButton1) or you can use the Image,  a Button Control(Id:->Updatebttn)
by CognitiveFeedback
Retrieve Connection String from user using Common Data Link dialog.
by ASP.NET Community
The AccessDataSource class is a data source control that works with Microsoft Access databases. Like its base class, SqlDataSource, the

Latest Articles

by #realJSOP
This library is intended for use in a multi-environment system, but it certainly be used under less stringent environmental confines, even down to a single desktop machine taht needs to connect to a single database server.
by Yamin Khakhu
Encrypting the configuration in Web.Config
by ASP.NET Community
In my case, I use  a FileUpload Control(Id:->FileUpload1), an ImageButton(ImageButton1) or you can use the Image,  a Button Control(Id:->Updatebttn)
by ASP.NET Community
Encrypt & Decrypt ConnectionString SectionSometimes we need to secure ConnectionString to prevent anyone can knows it. whatever your purpose from

All Articles

Sort by Updated

Connectionstring 

14 Sep 2023 by Richard Deeming
At a guess, you're trying to connect to .\SQLEXPRESS or something equivalent, which requires that the SQL instance is running on the same machine as your code. In which case, you need to update your connection string to point to the correct...
14 Sep 2023 by dolce_sweet
I have created a Maui Blazor app in .NET 7 which is pretty neat and runs beautifully locally. After installing the app on another Windows 10 Pro x64 machine, I get an error message that SQL Server Express (2019) cannot be reached. I get this...
6 Jun 2023 by Member 11400059
Hi I Create C# windows form project and setup file for it. but I get the error after install my app on my friends system. the error is: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The...
6 Jun 2023 by PIEBALDconsult
I recommend something along these lines: string server = null ; // Fetch from configuration string database = null ; // Fetch from configuration System.Data.SqlClient.SqlConnectionStringBuilder constr = new...
3 Jun 2023 by OriginalGriff
There is no single string that will work for all server instances, unless it always directs to one specific server - in which case you need two things: 1) The IP address or host name of the server: mySQLServber.mydomain.com for example. 2) The...
22 May 2023 by Troy Bryant
Hi - What I am trying is to access my connection string(s) from the appsettings.json file. But string is always null. Any help is greatly appericated. Thank you in advance. Appsettings "customers":[ { "name": "Customer One", ...
22 May 2023 by George Swan
My suggestion would be to add the appropriate connection strings to appsettings.json so that the last lines read something like this "AllowedHosts": "*", "ConnectionStrings": { "CustomerOneConnection": "Data...
22 May 2023 by Graeme_Grant
THis should answer your question: .NET App Settings Demystified (C# & VB)[^]
3 Apr 2023 by Member 15758581
I am Working on a Backuptool but now i ran into a problem, all my Items in my ListBox where they were read from an OpenFolderDialog all have checkboxes. Now here is my Problem, I want to get the checked Items into another ListBox called...
3 Apr 2023 by Graeme_Grant
You are using MVVM. You can use DataBinding to track selection. 1. Wrap the Model: public class CheckItemModel : ObservableObject { private bool isChecked; public bool IsChecked { get => isChecked; set => Set(ref...
26 Apr 2022 by semicolonerror
I have recently upgraded my excel from 2007 to 2019. I was using this "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ExcelPath & ";Extended Properties=""Excel 12.0 Xml;HDR=Yes;"";" as a connection string. It was working fine before. Now,...
26 Apr 2022 by OriginalGriff
Simple: one machine has both Excel engines installed, the other only has the latest version. Chances are you uninstalled 2007 before you installed 2019. Your connection string should be in a configuration file anyway, so it is set per machine...
21 Feb 2022 by ddrraamm
Hi,I have designed one vb.net application with ms access database.I use following connectionstring to Connect :Provider=microsoft.Jet.oledb.4.0;Data Source=D:\mydata.mdbI want to distribute this application to other users in LAN (Network)but should share common (centralized)...
14 Apr 2021 by OriginalGriff
You can't. FTP is not a file system, but a protocol to transfer data, and it doesn't allow directly access to files. FTP is not made for this scenario, and will not work.
14 Apr 2021 by Paramu1973
Hi, I wish to have a connection string for my ftp server with Static IP, Any Sample Query will be helpful. My Codes:- MyConnectionString=" Provider=Microsoft.ace.Oledb.12.0; Data...
9 Mar 2021 by #realJSOP
This library is intended for use in a multi-environment system, but it certainly be used under less stringent environmental confines, even down to a single desktop machine taht needs to connect to a single database server.
4 Feb 2021 by RickZeeland
It might be that you treat the encrypted data as a string, but we can't tell when you don't provide code. If that's the case, use base64 Format to convert it. It could also be that the version of aspnet_regiis.exe does not match 32 or 64 bits,...
4 Feb 2021 by houssem eddine ayari
Hello, i have developed an application with c# windowsform. I need to encrypt my connection string to hide my password (SQL Server as DB). What I have tried: I used RSA encrypting method and it works perfectly :
2 Feb 2021 by jsc42
Instead of using username / password in your connection string, use Security Support Provider Interface (see, for example, Security Support Provider Interface - Wikipedia[^] or sql server - What is the difference between Integrated Security =...
1 Feb 2021 by OriginalGriff
The problem is that in order to use an encrypted connection string, you need a decryption key - which means that you app must contain the key in a "readable form" or you app can't access the DB. And that means that anyone who actually wants the...
16 Nov 2020 by LUXDECADE
I'm working on a C# WIndows Forms project. The fact is that free hosting (remotemysql.com) has a limited number of equal to 10 connections. I have no right to change it, of course. I actually have a question: if I buy a...
16 Nov 2020 by Dave Kreskowiak
You app should not be connecting to a hosted SQL instance over the web. Your database should NEVER be directly exposed to the web. Use a web service between your app and the database. The web service would be doing all of the database work for...
16 Nov 2020 by W Balboos, GHB
This is totally on your hosting's head. MySQL Hosting[^] MySQL is totally configurable by the user - no limitations. You may wish to check other hosting providers - possibly the same cost (or less) for no connection limit.
10 Nov 2020 by xhon
----------------------------[ UPDATE ]---------------------------> I solved the issue by adding the connsectionString tag to the app.config in the executable project (not in the app.config inside the DataLayerAccess project) and it works fine. ...
25 Aug 2020 by Ann_Swap
Hi, I have couple of connection strings in web.config, ideally using those connection strings and the credentials specified (in web.config) I will have to open a connection and do an insert - for both the connections (lets says connection1 and...
26 Jul 2020 by Garth J Lancaster
hmmm .. I'm not as au fait with xaml etc as I should be .. but looking at this public static class GV // {Global Variables} { #region Members private static List connectionStrings; ...
26 Jul 2020 by oronsultan
Hi Guys, I have a sln in .Net which is based on 2 projects: - Wpf application under the name 'Installer' and a class library under the name 'InstallerCore'. - The 'InstallerCore' is responsible for accessing the data base and basically it is...
2 Apr 2020 by Member 11359369
'Create a Module and Create Fuction Connect ' You can connect From database local or network area Public Sub connect() Public Con As New OleDbConnection M_drivepath = Left(Application.StartupPath, 1) If...
2 Apr 2020 by lelouch_vi 2
Hello, I'm still a newbie so please pardon my question. I just want to know how to avoid hard coding the connection string in every sub in vb.net. I'm using vb.net 2017 and access as my database. I have multiple connections to my database and I...
19 Nov 2019 by OriginalGriff
We can't tell you - you should talk to the people who created it - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
19 Nov 2019 by jov_aco
Can anyone help about connection string to LAN device (Door access controller CHIYU BF Mini -W-E). I need to make bidirectional connection to this device, so I can get data from and send data to the same device. When I will get data from the device, the idea is to put that data in data Base and...
4 Oct 2019 by Landers52
I'm working on deploying my software using Advanced Installer and I want to attach the .mdf file located in the [APPDIR] (client pc's destination folder). I came across this connection string: ...
4 Oct 2019 by Gerry Schmitz
Quote: AttachDBFilename is unique to SQL Express, it spins up a user instance of SQL Express attached to a specific DB Filename for single user mode. Database is simply the name of the database to use, it has no additional connotation. For any production server, you would most likely not be...
25 Aug 2018 by Dave Kreskowiak
That should be an older style (Access 2003 and older) database. It normally uses the JET engine, not ACE, though ACE may still be able to open it though. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path to database.mdb; or Provider=Microsoft.ACE.OLEDB.12.0;Data Source=path to database.mdb; Of...
25 Aug 2018 by Alan Balkany
I'm learning ADO.NET and have been stuck for DAYS trying to get a connection string for a plain, vanilla .mdb database. I've been trying potential connection strings and permutations but NOTHING works; the database connection is never opened. The ODBC Data Source Administrator lists the driver...
26 May 2018 by dfarr1
Hello everyone - I've been trying to find a way to encrypt or further secure the web.config file for my website. I have read a lot of guides and my main limitation from these is that I am using web hosting on a shared server (GoDaddy, specifically) so I do not have access to root drive or...
12 Mar 2018 by F-ES Sitecore
oracleCommand only exists inside makeConnection so only code inside that function can access it, so I don't understand how your code even compiles. If you want to make a connection available you'll need to write a function like public static OracleCommand GetConnection() ...
12 Mar 2018 by Member 13716754
Here is my database connection class.I want to access 'oracleCommand' object reference from another class. public class DBConnection { //public OracleCommand oracleCommand; public string cmd = ""; public void makeConnection() { ...
13 Oct 2017 by akosisugar
newbie question.. What is the best way to configure the connection string, in Web.config or in a public method? im trying to create web project connected to a database [MSSQL SERVER 2008 R2].. What I have tried: using System; using System.Collections.Generic; using System.Linq; using...
13 Oct 2017 by OriginalGriff
Web.config If you hard code the string you have to recompile the code when it changes. And it changes every time you do maintenance, or upgrades. Because if it doesn't, your code tests against the production database and everything you do risks disaster. If you forget the WHERE clause for an...
11 Oct 2017 by Member 12704629
I am creating a simple software in vb net that open a connection to a sql server in which the name of the table that i need to retreive cointains an exclamation mark, the string for the sql statement i am using is the following. Dim strSQL As String strSQL = "select * from dbo.!Lotti" ...
11 Oct 2017 by OriginalGriff
Try: strSQL = "select * from dbo.[!Lotti]"
20 Sep 2017 by Onur ERYILMAZ
Hi; I have a C# program that connects the sql server database. I can connect this database with this connection string on my computer; "Data Source= DESKTOP-E0NKE43\\MYINSTANCE; Database= MYDB; Integrated Security= True;" But when I put this program to another PC, I cannot connect with this...
20 Sep 2017 by OriginalGriff
"Integrated security" is probably your problem, if the DB is still on the same PC as it was - the user on the "new" machine probably isn't authorised to access your computer. You shouldn't really use integrate security in production anyway - using SQL authentication allows you to select an SQL...
12 Sep 2017 by Abhimaan Sharma
I tried to all the possible solutions, but code is not working. Getting same error again and again. Infact, I've installed the same from below link: https://www.microsoft.com/en-us/download/details.aspx?id=13255 What I have tried: string ExcelContentType = "application/vnd.ms-excel"; ...
12 Sep 2017 by Dave Kreskowiak
Did you install these[^]? If your app is compiled targeting x64, you have to use the 64-bit version of the runtime. If your app is compiled targeting x86, you have to use the 32-bit version. If your app is compiled targeting AnyCPU, it depends on which O/S your app is running on: 32-bit...
3 Aug 2017 by Manik Ghosh
I am trying to connect to my oracle database using following connectionstring. "Provider = OraOLEDB.Oracle; User Id = ; Password = ;Data Source = "; But getting following error: ORA-12154: TNS:could not resolve the connect identifier specified Please...
3 Aug 2017 by Kornfeld Eliyahu Peter
Oracle Provider for OLE DB Connection Strings - ConnectionStrings.com[^]
25 Apr 2017 by Ajay Bachale
Hi All, I would like to use identity (windows account) provided in IIS to connect to Sybase 15.7 database. I am using ASEOledb provider to connect in code. But I am not able to connect to database by passing Integrated Security = true in connection strinf. Can some one help on this? Thanks...
25 Apr 2017 by Dave Kreskowiak
From what I can tell at ConnectionStrings.com and the Sybase documentation here[^] Trusted Connections how you want to specify it are not supported. You MUST supply a username and password in the connection string or the Data Source IDS file.
27 Feb 2017 by ahmed_sa
I need to know are this connection string to excel is wrong or true public static string fileName = string.Format("{0}\\Book502", Directory.GetCurrentDirectory());string connection = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source={0};Mode=ReadWrite;Extended...
27 Feb 2017 by Richard MacCutchan
See Working with MS Excel(xls / xlsx) Using MDAC and Oledb[^].
27 Feb 2017 by Divya-Systematix
Hello,You can refer this link, i think it's helpful for you.How to Read Microsoft Excel 2007 Using a Connection String in C#[^
26 Feb 2017 by Sameera Liyanage
From last two days i am triing to connect postgress database from web api. but i couldn't do that. please help me to solve this. Below is my connection string.
26 Feb 2017 by Manoj Chamikara
I'm Using ASP.NET MVCThis is my Configuration Connection String but i cannot connect to the database Exception - An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions...
26 Feb 2017 by Bryian Tan
Google is your best resources too. Let me Google that for you[^]Here are some links that describe the exact same issue and might help your caseIssue : The provider did not return a ProviderManifestToken string.[^]Error: The provider did not return a ProviderManifestToken...
19 Jan 2017 by Member 12955507
Hello everyone, I have created 2 .exe wpf windows application. One is for client machine and 2nd oen is Admin machine. And the machines should under common network. Then, I am planing to populate, a ask window for adding client's IP address after installation client .exe on client machine...
29 Dec 2016 by Francesco Bigi
Hello guys!I quite a beginner for the environment MVC .NETI am trying to connect my SQL db to my project MVC, but honestly I do not understand what to put as parameter.My connection db sql is:Server Name: CBL-LT138388\SQLEXPRESSInstance Name: SQLEXPRESSdatabase : WebShopUser Name:...
29 Dec 2016 by Francesco Bigi
Oook I see now.When I follow the instruction which you wrote me it creates automatically a connectionStrings:
28 Dec 2016 by OriginalGriff
Your connection string looks very wrong: you are saying that you want Integrated Security, but then you supply a - very dangerous - user name "sa" and a - probably invalid - password of blank.Getting a valid connection string is pretty simple: try setting up a connection in VS with the...
27 Oct 2016 by TatsuSheva
I have a C# Application which would access a MySQL server using WAMP on another computer. I am trying to do it via IP. Here is my Connection String :server = "192.168.10.221";database = "restaurantdb";uid = "root";password = "";string connectionString;connectionString = "SERVER=" +...
27 Oct 2016 by TatsuSheva
I got this error...MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
27 Oct 2016 by #realJSOP
Put a try/catch block around your code , and it will tell you exactly what's wrong. My guess is that it's a permissions problem.
6 Oct 2016 by DRD94
At the moment I am storing my connection strings in my app.config file in plain text. Bad practice, I know, and I am trying to encrypt them instead. I've referred to https://msdn.microsoft.com/en-us/library/ms254494(v=vs.110).aspx and haven't had an issue with getting the app.config part working...
6 Oct 2016 by #realJSOP
How are you encrypting the connection string?The way I do it is encrypt the string, and copy the encrypted version into the config file. Then, I have an assembly that I can distribute that knows how to decrypt it (it contains the encryption info). If you want to decrypt the encrypted string,...
6 Oct 2016 by F-ES Sitecore
https://msdn.microsoft.com/en-us/library/ff650304.aspx#paght000006_webfarmscenarios[^]
8 Jul 2016 by F-ES Sitecore
You don't need the "@" at the front, so leave that bit out. The @ isn't part of the string, it is an instruction to the compiler to treat all characters as literal. It is used when dealing with paths so you don't have to escape the "\" characters.SqlCeConnection con = new...
8 Jul 2016 by Member 11905879
hi, i am able to connect to my local db file .sdf directly with my winform app. but unable to do so when i am using an connstring. here is what i have tried1. using app.config filevar config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var...
6 Jul 2016 by myl711
It says the specified DSN contains an architecture mismatch between the driver and application. Please helpppp...What I have tried:I have set a DSN (EDM_PROD) in ODBC Data Source Administrator and I have this code: DSN=EDM_PROD;UID=xxxx;PWD=xxxx What am I doing wrong?
6 Jul 2016 by Jörgen Andersson
You need to use an Oracle client with the same bitness as your application. So either install the 64 bit office, or use the 32 bit Oracle client.
10 Jun 2016 by Eikistein
I am intermediate developer and I have a situation whereas a I have single WCF service hosted on a server that hosts a connection to a database. This is WCF service is currently accessed by a WinForms application. My customer would like to have the capability to be able to change the database...
10 Jun 2016 by F-ES Sitecore
When you create your context object you can use the constructor overload that accepts the connect name or string as an argument;DbContext Constructor (String) (System.Data.Entity)[^]var ctx = new PortalDB("connection here");
22 Apr 2016 by ENG.Samy Sammour
hello everybody, I just uploaded my website today but I got a problem with connection string, the code was working 100% in local server but I want to put on the server.but the error is with the entity framework connection string.this is the error: System.ArgumentException: Format...
7 Mar 2016 by bjay tiamsic
Hi. I have just opened a system in my employer's folder which was created by the previous developer about 5 years ago. However, I am having a hard time checking where the connection string is set upCan you help me identify where it is coming from/setup?Here is the connection string set...
7 Mar 2016 by Maciej Los
Web.config file contains 2 definitions of connection string:SUPPLYConStrconString
21 Feb 2016 by Jones Aaron
I am using Visual studio 2013 to write my web app using MS SQL Server 2012 backend. Below is my connection string which works fine.
21 Feb 2016 by OriginalGriff
First off, for production you shouldn't be using (localDB) - you shoudl be using the actual name of the SQL server instance that your hosting provider has set up for you.And secondly, attaching a DB is a bad idea in a web environment - you are much, much better off creating the DB in the SQL...
11 Feb 2016 by oronsultan
hey guys, this is the situation:i have a pc with sql server (express) 2012 install on it. i have a laptop and i am trying to connect to a database on the pc throug c# application on my laptop. after manipulayting all of the settings including open port, firewalls and tcp/ip protocols, i...
11 Feb 2016 by Garth J Lancaster
I'd be looking at tracing the route between the two networks that dont work - ie, its obvious when you're on the same network, but when you're on a different network, there's nothing to say 'to get from network a (eg 'another wifi or phone) to network b (the one where sql server is running on...
22 Jan 2016 by czaar999
I created a proxy like this in the article and it worked. https://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
21 Jan 2016 by Brian Lace
looks like a file system permission issue
21 Jan 2016 by czaar999
I created and SSIS package to extract data from MS access db. It runs fine on my local machine but fails when I run it on the server in SQL server agent job. Please help. Thanks in advance.Points to note:1.) Access database has no username and password2.) I disabled 64 bit on the...
11 Jan 2016 by Mohsen.srn
Hi, I am a Beginner.I Just Uploaded My ASP.NET MVC Site to a Host. But is does not works.My Exact Question is in "server" property of bellow connection string:connectionString="server=' ';database=' ';User Id= ' ';password=' ';"should i put servers address or should i put...
9 Jan 2016 by Dave Kreskowiak
You can't. An .MDF file can only be attached by a single instance of SQL Server Express at a time, or whichever local server you're using.If you need to "share" that file among multiple instances of your application you need a single SQL Server to host the database. All of your application...
9 Jan 2016 by Richard MacCutchan
Not sure what an MDF file is, but you can generally find the answer to this question at ConnectionStrings.com - Forgot that connection string? Get it here![^].
9 Jan 2016 by alienqueen
I use c# windows form.I create server mdf file in D:\try.mdf and i want to reach another computer to this file and i want to use this mdf file. How can i write connection string and what can i do to solve this problem. help please
16 Dec 2015 by phil.o
SQL Server default port is 1433, not 1443. You're having a typo in your connection string.Moreover, what is the Class variable you are using in your try..catch block? Shouldn't it be the config variable here instead?The error message seems to indicate that the config.getUrl() method is...
16 Dec 2015 by hansoctantan
I am creating a web application with a account module. I can successfully login using the below connection and query. Also my TCP/IP is enable and its properties AP Adddress -> IPAll -> TCP Port is set to 1443public class ConnectionDAO { protected Connection conn = null; protected...
4 Dec 2015 by ZurdoDev
There are several possible causes of the error and so you'll need to troubleshoot it on your end. Here is a Microsoft article on how to figure this one out, https://technet.microsoft.com/en-us/library/ms175496(v=sql.105).aspx[^]
4 Dec 2015 by Asutosha
Hi All,I have a application which interact with database using web service.The web service use ado.net to connect database and interact. I have a log file which record any database related error.In the log file I am getting below message and sometimes this is happening.I am...
23 Nov 2015 by Richard Deeming
You're looking at the wrong "provider". The one in the connection string is the OLEDB provider. You need to look at the ProviderName on the ConnectionStringSettings object.Connection Strings and Configuration Files[^] ...
23 Nov 2015 by Jörgen Andersson
"This provider is installed on my computer"But is it registered in your machine.config or app.config?When you run DbProviderFactories.GetFactoryClasses you'll get a datatable with a row for each installed provider.To get the actual factory you need to run...
18 Nov 2015 by Skippy II
Hi all,I have a connectionstring and need to create the appropriate connection without knowing it to be a OleDBConnection, SQLConnection or ODBCConnection.On the internet I read that I could use DbProviderFactories.GetFactoryClasses and find the right provider, based on the "Provider="...
2 Nov 2015 by Andy Lanng
If you have copies the database from your machine to another you may need to change the security.Bizarrely, if the target server has the same login credentials as the newly attached database, they do not sync. You have to remove the previous credentials and add them back from the server...
1 Nov 2015 by kozmikadam
Hello everyone ,Here is my problem ,I develop a form application in my computer. And here is my connection string : "Server=localhost;Database=atak_db;Trusted_Connection=True;"and this is works.Now i want to install this form application at another computer.Other computer...
30 Oct 2015 by AnvilRanger
From your comment you pretty much have your answer.If SQL server is running on you local development box, then chances are good that your server will not have access to it. What you need to look into is either using a separate SQL server that you host can access or look at installing SQL...
28 Oct 2015 by Garth J Lancaster
I dont know if its just the way you've posted that info in your question, but, it appears as though your connectionStrings is part of/'under' startup - I dont think it should be - try moving it 'up' a level' or at least change this
28 Oct 2015 by phil.o
The problem is not the connection string.A NullReferenceException is throw when you try to access an instance member of a given variable while this variable has not been initialized, or been disposed.Somewhere in your code file, there is a line where you are using a variable of which you...
28 Oct 2015 by Rencyrence
I have problem with connection String, Error (Object reference not set an instance of an object) how to debug this pleaseMy app.config ...
28 Oct 2015 by Zoltán Zörgő
Wait a second.1) IIS does not connect to any RDBMS, except for storing session state - it is only a setting you can use in your application2) SQL Express does not enable TCP/IP connector by default, you need to enable it[^].3) For this to work, you need to have specific port level...