connection-string

What is the ConnectionString to create a OdbcConnection for an access mdb file

不问归期 提交于 2019-12-10 19:14:42
问题 I want to connect from c# to an Access MDB file by using Odbc. When I try to execute OdbcConnection con = new OdbcConnection( "Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\temp\\test.mdb;"); I get the following exception: exc {System.Data.Odbc.OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc

Problem with connectionstring and entityframework

▼魔方 西西 提交于 2019-12-10 18:31:03
问题 I have a database (sql 2008 mdf file), a class library project with an edmx file, created with the wizard. So the connection string is also made by the wizard. This project is on a teamfoundation server. I can use all the wizard made objects when coding. But when i run the program and I try to make an entityContainerName, the program crashes and gives this error: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or

ODP.NET Integrated Security Invalid Connection String Argument

若如初见. 提交于 2019-12-10 17:57:34
问题 What am I missing? <add name="test" connectionString="Data Source=TEST_ORACLE;Integrated Security=Yes;" /> [ArgumentException: 'Integrated Security' is an invalid connection string attribute] Oracle.DataAccess.Client.OracleConnection.ParseConnectionString() +2707 Oracle.DataAccess.Client.OracleConnection.set_ConnectionString(String value) +533 Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString) +210 ODP.NET: Oracle.DataAccess - 2.102.2.20 (I am using a bindingRedirect to

JDBC Connection String Syntax and Anatomy

一个人想着一个人 提交于 2019-12-10 17:47:53
问题 I have used JDBC to connect to many different relational systems over the years: H2, HSQLDB, MySQL, Oracle, Postgres, etc. And in every case, each system seems to have its own flavor of connection string syntax. I can't imagine that a long-standing API like JDBC wouldn't have a defined, enforced grammar for connection string validation. For example: Some valid HSQLDB connection strings: jdbc:hsqldb:mem:mymemdb jdbc:hsqldb:res:org.my.path.resdb jdbc:hsqldb:file:/opt/db/testdb MySQL: jdbc:mysql

Oracle Connection String With Windows Authentication

心已入冬 提交于 2019-12-10 15:53:16
问题 We have a requirement to make our products work on Oracle as well as SQL Server (around which they were originally built). Unfortunately we don't have any in house Oracle development experience to speak of but as a senior dev it has fallen to me to lead the project. So far I have managed to make our app connect to an Oracle database (I'm using Oracle XE 11.2) by using the following connection string: Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=VS010-ORA11GR1)(PORT=1523))(CONNECT

Setting an ODBC connection string in VBA

自闭症网瘾萝莉.ら 提交于 2019-12-10 14:52:22
问题 I have created a macro that sends a new CommandText to an ODBC Connection in my Excel spreadsheet and then refreshes the table of results associated with the query. This has been working fine, but I've noticed that each time I run the macro it overwrites the connection string with some default values that work on my machine but will not work on other users' machines because they do not have the saved connection file that I have. The more specific connection string that specifies a server

Read an in-memory Excel file (byte array) with ADO.NET?

心不动则不痛 提交于 2019-12-10 14:24:06
问题 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 byte array in memory. For security and performance reasons I would rather not write this file to disk. Is there a way of constructing a connection string that connects to a byte array? Or perhaps exposing that array as a file that is actually stored in memory (like a RAM disk I guess)? 回答1: You can

connection timeout property in connection string ignored

大憨熊 提交于 2019-12-10 12:45:47
问题 I'm building an app in C#. I'm using a connection string like: DSN=SomeDataSource; Trusted Connection = yes; Uid=SomeId; pwd=somePwd; Connection Timeout=x But no matter what value I set as x ( Connection Timeout = x ), by putting a breakpoint, I can see that my DbConnection object's ConnectionTimeout property always has the default value 15 . Am I missing something here? Thanks. 回答1: The Connection Timeout in the ConnectionString only controls the timeout for the connection. If you need to

Amazon AWS RDS - How to Programmatically Create a MS SQL Database in C#?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:29:34
问题 I've created an Amazon AWS RDS instance running MS SQL. I've successfully been able to programmatically create a database in C# using: SqlConnection myConn = new SqlConnection("Data Source=<public-ip-name>;Persist Security Info=True;User ID=<userid>;PWD=<pwd>;"); myConn.Open(); string str = "CREATE DATABASE contacts"; SqlCommand cmd = new SqlCommand(str, myConn); cmd.ExecuteNonQuery(); However, I haven't been able to make a more complex connection string work: str = "CREATE DATABASE contacts

ConnectionString for remote SQL Server

↘锁芯ラ 提交于 2019-12-10 12:00:59
问题 This is the case, I want to connect to SQL2008R2 that is located on a remote server, I can enter to the server remotely and after I login as an admin on windows I work on the SQL Server MS (The connection to SQL is through Windows Authentification). I am working on a WinForms App that needs connection with SQL, I have tried several connectionString without success, for example: public static string strCon = @"Server=190.xxx.xxx.xxx\ServerName,1433;Database=DataBaseName;Integrated Security