All Questions
Tagged with connection-string ado.net
116
questions
445
votes
22
answers
859k
views
Get connection string from App.config
var connection = ConnectionFactory.GetConnection(
ConfigurationManager.ConnectionStrings["Test"]
.ConnectionString, DataBaseProvider);
And this is my App.config:
<?xml version="1.0" ...
34
votes
9
answers
63k
views
Keyword not supported: 'server'
I've been trying to edit my connection string for uploading my website to a server.
I am not really experienced with this. I got this exception: the Keyword not supported: 'server'.
Here is my ...
23
votes
4
answers
39k
views
C# Retrieving correct DbConnection object by connection string
I have a connection string being passed to a function, and I need to create a DbConnection based object (i.e. SQLConnection, OracleConnection, OLEDbConnection etc) based on this string.
Is there any ...
23
votes
4
answers
60k
views
What is the maximum and minimum size of connection pool ADO.Net Supports in the connection string?
What is the maximum and minimum size of connection pool ADO.Net Supports in the connection string.Min Pool Size=[max size ?]Max Pool Size=[min size]
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=...
14
votes
2
answers
7k
views
How to get provider specific ConnectionString from Entity Framework
using ado.net tipically we need to define a connectionstring to create a sqlconnection object, and if we use the entity framework, we have to dedine a connectionstring too.
is threre any way to get ...
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 ...
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 ...
10
votes
3
answers
17k
views
ASP.NET: How to create a connection from a web.config ConnectionString?
How do you construct a DbConnection based on a provider name?
Sample provider names
System.Data.SqlClient
System.Data.OleDb
System.Data.Odbc
FirebirdSql.Data.FirebirdClient
i have connection ...
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?
6
votes
4
answers
6k
views
How to connect to mirrored SQL Server after failover?
I set up a database mirroring and then used this connectionstring to connect to it:
Data Source={0};Failover Partner={1};Initial Catalog=AdventureWorks;
Integrated Security=True;
After ...
6
votes
3
answers
3k
views
ADO.NET: Can't connect to mdf database file
I'm writing an application that uses a SQL Server 2005 database. In the connection string I'm specifying the mdf file like this:
connstr = @"Data Source=.\SQLEXPRESS; AttachDbFilename=" + ...
6
votes
2
answers
18k
views
Specification of Extended Properties in OleDb connection string?
At the moment I'm searching for properties for a connection string, which can be used to connect to an Excel file in readonly mode. Searching Google gets me a lot of examples of connection strings, ...
6
votes
2
answers
573
views
cannot open database - requested by the login - why can't I connect to my DB?
I'm trying to insert some data into my DB (Microsoft SQL Server)
My connection does not open and I get this message:
Cannot open database \"[Sales and Inventory System]\" requested by the login. ...
5
votes
2
answers
14k
views
Connection string for default instance like for named instance
In my .NET application I am connecting to Microsoft SQL Server 2005 or 2008 database. User selects instance which the application shows it and then application should do something with this instance. ...
5
votes
2
answers
3k
views
If add [user instances=true] to connection string, an exception is thrown
Exception Details:
System.Data.SqlClient.SqlException: can not open the logon request database "RealtyDB"
login failed. account 'FAFHN24BNK43\JKAD754' login failed.
My connection string looks ...
5
votes
3
answers
3k
views
How to get server name through code if SQL Server (Standard Edition) is installed
How to get server name through code if SQL Server (Standard Edition) is installed.
We pass the server name while creating a connection string to connect SQL Server. Can we retrieve this value through ...
5
votes
3
answers
5k
views
Read an in-memory Excel file (byte array) with ADO.NET?
I want to use ADO.net to extract some data from an Excel file. This process is pretty well documented on the internet. My catch is that my file has been uploaded by a user, and so exists only as a ...
5
votes
1
answer
16k
views
Setting collation property in the connection string to SQL Server 2005
I have a ASP.Net web application with connection string for SQL Server 2005 in the web.config.
Data Source=ABCSERVER;Network Library=DBMSSOCN;Initial Catalog=myDataBase;
User ID=myUsername;...
5
votes
2
answers
3k
views
Where to store Connection String
I am creating a Class Library which contains all the custom classes I regularly use in the applications I develop. This library is compiled and added as a Reference in each of my applications, ...
4
votes
3
answers
6k
views
Using an entity framework connection string in ADO
We have a need to use an old fashioned ADO database connection in one tiny part of the main entity framework application.
We can manually specify the connection string in this part of code, but given ...
4
votes
2
answers
6k
views
Get Connection String Without Password Value in C#
I try create method for get the connection string value but without value for password, or show password like * character. I need used it in logging.
I use ConnectionStringBuilder for Oracle, ...
4
votes
2
answers
2k
views
ADO.NET connection string and password with "=" in it
How do I build a connection string which includes a passsword having a "=" in it? (I'm connecting to MySql 5.1)
For example, let's say the password is "Ge5f8z=6", what would the connection string ...
4
votes
1
answer
2k
views
What is the Type System Version (Compatibility Level) for SQL Server 2012
What Type System Version (Compatibility Level) token can I specify in ADO.NET connection string to indicate that only SQL Server 2012 is supported?
3
votes
1
answer
401
views
Why Doesn't The EntityConnection Object Contain the Login Password?
I've got an app that uses EF CTP5.
In this particular situation, i need to degrade to some classic ADO.NET (in order to read multiple result sets in a stored procedure, which EF does not support).
...
3
votes
1
answer
3k
views
Visual Studio 2010's generate model from database gives error message when trying to connect to DB with MySQL ADO.NET drivers, how to fix?
I am trying to generate my ADO.NET entity model from my MySQL database using the official Connector/Net 6.4.3 ADO.NET drivers from MySQL. However, after I type in my DB-info, and click next (Test ...
3
votes
1
answer
822
views
What's the deal with |Pipe-delimited| variables in connection strings?
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is that hard-coded or is there a generalized mechanism at work along the lines of %environment variables%?
3
votes
1
answer
17k
views
Keyword not supported: 'provider'
I'm Having this error:
Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more ...
3
votes
2
answers
5k
views
Connecting to SQL server via TCP/IP, not NP
As I found out, my SQL server has disabled Named Pipes, but enabled TCP/IP (and it will stay this way). Now I am trying to connect from the visual studio to the database, but with no luck.
I've tried ...
3
votes
2
answers
1k
views
Can't open a connection to SQL Server 2005 from a pocketpc (windows mobile 6)
I'm trying to connect from a pocket pc app (windows mobile 6) to a SQL Server 2005, but no matter how hard I try it didn't work. I checked every possible configuration for enabling tcp on SQL Server, ...
3
votes
2
answers
5k
views
Executereader and execute non-query in a single connection in ado.net
The below snippet employs multiple queries inside the same connection string. first i'm selecting the some datas from the DB then before closing the datareader(dr) i would like to do some validations ...
2
votes
7
answers
26k
views
How to check is connection string valid?
I have to save data and I have to test connection before to save it. How can I test that this connection string is valid for a particular connection?
My code is like this:
static public bool ...
2
votes
2
answers
3k
views
How to convert CCSID 65535 characters in AS400 ADO.Net connection string
I'm trying to set things up such that I can read binary data from the AS400 database without having to put "CAST(TABLE.COL AS CHAR(29) CCSID 37) COL" on every selected column. It's a pain to put that ...
2
votes
4
answers
12k
views
Connection string for Informix for .NET
We are using an Informix database, and are connecting to it from .NET sucessfully using ODBC. The connection string we are using is;
DRIVER={IBM INFORMIX ODBC RIVER};
UID=username; PWD=password;
...
2
votes
3
answers
334
views
Unable to connect to Local SQL database from app.config in windows form application
i am trying to connect my local MySQL database to my windows form application using app.config.
but i am keep on getting the below mentioned Exception.Can anyone help me please.
Exception :
App....
2
votes
2
answers
9k
views
C# and SQL Server connection
I can't seem to connect to my local database.
Everytime I run it, it gives me a pop up blank windows (blank command line windows).
What do I miss?
using System;
using System.Collections.Generic;
...
2
votes
4
answers
6k
views
Database Connectivity ASP.NET - PostgreSQL
Am trying to run a C# application which fetches data from PostgreSQL database(8.4) and am using the PostgreSQL OLE DB Provider
This is my connection string
string connString =
@"Provider=...
2
votes
6
answers
732
views
Where i put the Connectionstring with numerous client?
i will develop utility program for a company with more than 1000 client and the program must be win application with .Net because my program will act with another program.
What is your suggest for ...
2
votes
3
answers
1k
views
Point ADO.Net DataSet to different databases at runtime?
I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints. The dataset will work with either schema, but I want to be able to tell the dataset which schema to use (...
2
votes
2
answers
2k
views
.NET4.0 SqlConnectionStringBuilder missing ApplicationIntent and MultiSubnetFailover properties
I have this .Net Framework 4.0 project. I added System.Data as a reference.
I am trying to construct a connection string with a DbConnectionStringBuilder, instead of directly using a string.
...
2
votes
2
answers
1k
views
Simplest way to get ADO.NET connection string for mdb database
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;...
2
votes
1
answer
4k
views
Informix "Invalid Argument" exception with connection string
I have been looking online for days trying to solve my problems and I cannot find anything which hints as to why I get this issue.
The exception is: System.ArgumentException: Invalid argument
I am ...
1
vote
3
answers
964
views
.NET - SQL Connection Error - Developing a Web App Locally
I have Visual Studio 2008 and SQL Server 2008 Developer Edition installed on a Windows XP machine.
I get this error when trying to work on a Test Web Application:
A network-related or instance-...
1
vote
1
answer
482
views
Isn't it possible to authenticate into a DBMS through ODBC without having to specify the user credentials in the connection string?
I'm trying to log into a SQL Server database through ODBC (the DSN is well configured) but when I try to make the connection in .NET it keeps me asking for the user credentials that I already saved in ...
1
vote
1
answer
561
views
How are OLE DB connection strings mapped to DLLs?
How does the OleDbConnection constructor know what provider DLL (I assume it's a DLL) to call for a given provider name in the connection string? For example, in the following code...
string cnStr = "...
1
vote
1
answer
385
views
How to use Oracle Managed DataAcess provider to access a local Oracle XE 11.2 instance?
I downloaded and installed Oracle XE 11.2 on my developer machine. I managed to access it with SQL Plus using the SYSTEM username and the given password.
Now for testing purposes I need to access ...
1
vote
2
answers
2k
views
connection to a sql server database by ip
I am doing an application that connects to a database located in the same network. the DBMS is SQL Server 2005 and i'd like to test the ping to the ip adress and then test the connection to the ...
1
vote
2
answers
4k
views
UDL file for creation a connection string
I am going to use UDL file to create connection.
Is there any difference between UDL file with oracle connection string and MS SQL Server connection string?
Can I use:
DbConnection con = new ...
1
vote
2
answers
4k
views
ADO.NET SqlClient connection string - Data Source syntax
Is there any official write-up what forms can Data Source field take in sql server connection string? I'm aware of following forms:
SERVER
SERVER\Instance
tcp:SERVER,port
nb:SERVER
nb:SERVER\Instance
...
1
vote
1
answer
7k
views
Microsoft.ACE.OLEDB.12.0 driver for x64 app - how to make it work with x86 MS Office installed?
Microsoft.ACE.OLEDB.12.0 driver is not working on my PC, I am trying to fix it.
Error on connection opening is: "Provider cannot be found. It may not be properly installed."
Here is what i got now:
...