Click here to Skip to main content
15,892,537 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 

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,...
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.
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.
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"; ...
19 Feb 2015 by Abhinav S
Try theseHow to get Connection String from App.Config in C#[^]Connection Strings and Configuration Files[^]
6 Mar 2015 by abid zahid
Hello every onei am new to winforms and i am creating a project with ms access database 2007 (.accdb) the problem is i want to create connectionstring but without directory path so please help methanks
17 Jan 2013 by ACE_
Just Share your folder databaseand change path other user...like this...Dim MDBConnString_ As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\172.16.0.233\DatabaseFolder\DatabaseName.mdb;"
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...
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...
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...
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...
12 Dec 2013 by Ali_100
Provider=Microsoft.Jet.OLEDB.4...
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
25 Aug 2013 by alifat92
i'm trying to write Connectionstring to Web.config like this: and read from it like this:string strcon =...
27 Dec 2013 by An@nd Rajan10
i was developed a project, i wants to find connection string of server at dynamically. and thats must be on app.config, because of the each and every connection from app.config..so i need to find connectionstring on app.config at dynamically,that is possible..RegardsAR
16 Aug 2013 by André Kraak
Should string not be with a capital S - String[^].
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...
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...
27 Jan 2013 by Anurag Sinha V
Hi,Nothing looks suspicious in your code except for the ConnectionString...What does AttchDbFileName do??Anyways you might want to try a normal ConnectionString as below:connectionString="Data Source=MY-PC;Initial Catalog=Sample; Integrated Security=trueLet us know if it...
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...
21 Apr 2014 by Aravindba
Hi Declare this after u get path in DUP1 DataRow t; j = s.Rows[0]; x = s.Rows[1]; t = s.Rows[2]; DUP1 = j.ItemArray.GetValue(1).ToString(); //here u declare string and create oledbconnection.what u try before u getting valule for DUP1 u...
11 Oct 2013 by ASP.NET Community
The AccessDataSource class is a data source control that works with Microsoft Access databases. Like its base class, SqlDataSource, the
2 Mar 2014 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)
11 Oct 2013 by ASP.NET Community
Encrypt & Decrypt ConnectionString SectionSometimes we need to secure ConnectionString to prevent anyone can knows it. whatever your purpose from
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...
29 Apr 2014 by BELGIUMsky
Can anyone tell me if you can use the sspi security option in the connectionstringto delegate the user credentials to the sql server?EDIT:Is this possible by using impersonation or delegation or both
16 Aug 2013 by bhawin parkeria
string^ constring=L"datasource=localhost;port:80;username=root;password='';";MySqlConnection^ conDatabase=gcnew MySqlConnection(constring);MySqlCommand^ cmd=gcnew MySqlCommand("select * from eventor.user",conDatabase);MySqlDataReader^...
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...
21 Jan 2016 by Brian Lace
looks like a file system permission issue
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...
27 Jan 2013 by christine tan
Hi guysi am inserting a string and a int into a database. There is no error but the code below didn't work. i am thinking it is the connectionstring which work on my WPF application. Can you please advise me on what went wrong. TIA! :Dstring a = textBox1.Text; string b =...
27 Jan 2013 by christine tan
I have solve it, the problem lies on the database. i have change the database to sql server 2008 instead of the one in visual studiothanks everyone for your help :D
10 Apr 2013 by CognitiveFeedback
Retrieve Connection String from user using Common Data Link dialog.
10 Apr 2013 by CognitiveFeedback
Retrieve Connection String from user with Data Link Dialog
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...
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/
6 Mar 2015 by DamithSL
check below article Social Club: Sample application using WinForms, C#.NET, ADO.NET and MS Access[^]
13 Aug 2015 by Dave Kreskowiak
If the server is in one AD domain and your user account is in another, but default, there is no trust relationship between the two domains. Your login will not work.To fix this you either need to setup a trust relationship between the domains to that the SQL Server's domain trusts the one...
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...
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.
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...
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...
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...
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)...
3 Jun 2015 by deepa.sukan
Please give syntax for adding 'alternate Servers' to the Informix DB connection string in web.configI have tried the below connection string. But it failsconnectionstring="provider=msdasql; Driver={ INFORMIX 64-BIT}; DB=MSN; HostName=abv.test.com;PortNumber=1039; ServerName=test9b;...
19 Feb 2015 by Derek Kennard
Hey Fellow Coders, I want to open a dialog to find out what the community does in this type of situation. I need to connect to the SQL Server I have for this Window. The code below works just fine, but I don't like it. What I really want is a way to "make a connection" without a connection...
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...
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#[^
24 Apr 2014 by Dnyaneshwar@Pune
Referhttp://www.c-sharpcorner.com/UploadFile/dsdaf/ConnPooling07262006093645AM/ConnPooling.aspx[^]http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.110).aspx[^]
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 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...
30 Oct 2012 by Ed Gepulle
Unable to open the physical file "D:\_Web3rev\App_Data\dbStudent.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".An attempt to attach an auto-named database for file D:\_Web3rev\App_Data\dbStudent.mdf failed. A database...
30 Oct 2012 by Ed Gepulle
I am using DefaultAppPool application pool in my local IIS and the identity is NETWORK SERVICE. I tried creating another instance of login in another directory and it works but in this instance it failed and receiving the above error message. my windows authentication has nothing to do with this...
30 Oct 2012 by Ed Gepulle
Can somebody share his comment about my topic? its a connection string to my sql database. i can explain further.this is the true error that apppears:[SqlException (0x80131904): Unable to open the physical file "D:\_Web3rev\App_Data\database.mdf". Operating system error 32: "32(The...
30 Oct 2012 by Ed Gepulle
further:Line 29: sds.SelectCommand = "SELECT * FROM [myTable] WHERE [username] = @username AND [password] = @password";Line 30: Line 31: DataView dv = (DataView)sds.Select(DataSourceSelectArguments.Empty); -->> this is the errorLine 32: tryLine 33: {
30 Oct 2012 by Ed Gepulle
after doing some changes in my IIS this is the error:Cannot open user default database. Login failed.Login failed for user 'IIS APPPOOL\DefaultAppPool'.
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...
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...
18 Sep 2012 by Enver Buzoku
Shows how to encrypt only the passowrd of an MS SQL connection string in the App.config of a .NET application.
4 Oct 2012 by ernieball_26
I want to know if it is possible to decrypt "DataProtectionConfigurationProvider" which is responsible in encrypting the connectionString in the web.config file. I am not the one who developed the system that is why I need to know the decrypted value. I have been searching for solutions or...
25 Oct 2014 by Esmaeil Ebrahimi
hi i have a c# applicaion with sql server databasei have a server with below informaion :windows server 2008 r2 -> user:adminisraor pass :123this system have a DHCP ip 192.168.1.59sql server 2012 r2 - > mix mode login enabledwindows authentication -> win7-user105sql...
2 Sep 2015 by F-ES Sitecore
That will work on your machine if your SQL instance is called "myservername" as "." means your local machine so ".\myservername" means the SQL instance called "myservername" on this machine. It won't work on other machines as the code will look for SQL on their machine rather than yours. The...
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");
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...
6 Oct 2016 by F-ES Sitecore
https://msdn.microsoft.com/en-us/library/ff650304.aspx#paght000006_webfarmscenarios[^]
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() ...
21 Apr 2014 by Fazlan85
I am creating multi DB application from Access DB's. Using a Open dialog box I need to update the connection string DB file path for the access DB. This does not work and gives the error: No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D). But when I declare a string...
24 Apr 2014 by Fazlan85
Hi all I solved it.I did something like this..private void Form1_Load(object sender, EventArgs e) {static string dup = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DUP1 + ";Jet OLEDB:Database Password=1010101010 "; OleDbConnection db = new...
17 Jan 2013 by fjdiewornncalwe
If you are trying to use a central database for multiple instances of the application, then using Access is a really bad way to go.The correct solution would be to use a SQL Server instance on the machine hosting the database. If you don't have licensing for SQL Server you could always use a...
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:
27 Jan 2013 by furqanAshraf
Debug your code with a break point. I hope that will help you in correcting connection string when you actually got the error. Other wise its is fine.also try this SqlCommand comm = new SqlCommand("INSERT INTO Video VALUES('" + (a + b) + "'," + l + ")", con);instead of SqlCommand comm =...
15 Oct 2012 by Ganesh KP
Hi friends, I have one web service in which I have 3 vb.net modules1. ApplicationManager.vb 2. AgencyManager.vb3. InventoryManager.vband my service InventoryService.asmx in which I call the GeAllAgencies in the ApplicationManager.vb and in turn that method calls the GetAgency in...
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
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...
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; ...
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...
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...
28 May 2013 by Gokhan CETIN
Hi,I'm trying to get parent thread name/info in child thread. I want to do that; My classes need to use parent thread info for connect to database. My application running multithread and each threads classes connecting diffrent connection string. So when my parent threads create sub thread,...
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...
22 May 2023 by Graeme_Grant
THis should answer your question: .NET App Settings Demystified (C# & VB)[^]
20 Nov 2012 by Guptha Ch
Save both Connection strings of the databases in the web.config App.config file using Cofiguration Manager.based on your requirement use the if condition to assign Connection string to the SqlConnectio object.
27 Jan 2013 by guruprakashc
SqlCommand comm = new SqlCommand("INSERT INTO Video VALUES('" + a + b + "',1)", con);
23 Dec 2012 by hamid65215
hii use this code for connect to the SQL Server in my domain network connectionString="server=192.168.0.13,1433;Network Library=DBMSSOCN;Initial Catalog=RayanehSanatPB;User ID=sa;Password=123456;" providerName="System.Data.SqlClient" />i have one sql server 2008 and...
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...
23 Jun 2014 by Heba Kamel
how can i make connection string with .sdf databasethis is my connection string but it doesn't work" Data Source = 'Database1.sdf';"
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 :
15 Oct 2012 by I.explore.code
Generally, the rule is to open the SQL connection as late as possible and close as quickly as possible. Preferably you should open/close connections only the Data access layer i.e. the class(es) that directly access the data and no where else. What you can do is create a singleton connection...
23 Jun 2014 by Jafarinejadvazifehkhorani
as guys said go to this linkhttp://www.connectionstrings.com/sql-server-compact/[^]it seems that you need to use following lines to get the right db connection stringstring StartupPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);string...
11 Jul 2015 by Jahanzaib Niazi
Say i have ipaddress stored in string var=192.168.1.2 and i have to store it in URL as "tcp://var:8084/Class1" how could i accomplish this?How could i do this?plz answer this.
16 Sep 2013 by jim1972
Hi all,I understand that its always good practice to keep the connection string in app.config file.Here, i have 2 doubts:-1. In my user login screen,user is selecting the Database Name from a combo box.So how to keep the selected database name as part of the connection string in the...
3 Jul 2013 by Jitendra Ku. Sahoo
Hi,Is it possible to find who altered last time a particular ROW of a table last time ?Is it possible to find who are the user logged into database and executed some SP last time ?Is it possible who are connect to LIVE database from LOCAL system on a particular day ?Many many Thanks
19 May 2013 by Johnny J.
Try replacing "localhost" with the IP address of the machine:conn = new SqlConnection(@"Server=XXX.XXX.XXX.XXX;Database=OfficialAutomation;Integrated Security=true;");I assume that the user that is logged in can access the machine on the network?Otherwise, you might want to switch to SQL...
14 Feb 2015 by Johnny5er
Im working on a team project which was created in Visual Studio MVC with MySql. When testing everything locally it was fine. When i was ready to go live, i deployed the app through GitHub, everything went good, but just no data.I was using a local connection string with user=root and...
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.
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...
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 =...
24 Jun 2013 by Julio Zuart
Hello everyone! This is my first question ever so I hope I do everything correctly. Please feel free to provide feedback on how to use the community website since I'm eager to learn.I am about to complete an application that runs different databases, 2 locals within the client computer, and...
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...
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.