connection-string

In what format does SqlCeConnection expect its connection string arg?

百般思念 提交于 2019-12-02 11:56:42
问题 I have a call to SqlCeConnection.Open() that's failing. The exception message I'm getting is pretty generic: "System.Data.SqlserverCe.SqlCeException" (more generic than pretty) The pertinent code is: private DBConnection() { try { string conStr = "Data Source = " + filename; string cmpStr = conStr + ".tmp"; if (File.Exists(filename+".tmp")) File.Delete(filename+".tmp"); engine = new SqlCeEngine(conStr); if (File.Exists(filename)) { } else { engine.CreateDatabase(); } engine.Dispose(); objCon

Separate Read/Write Connection for SubSonic

纵饮孤独 提交于 2019-12-02 11:53:17
问题 The security policy at our client's production environment requires that we use separate connection to execute writes and read to and from database. We have decided to use SubSonic to generate our DAL. So I am interested in knowing if it is possible and if yes how? 回答1: You can specify the provider SubSonic is using at runtime. So you would specify the read provider (using your read connectionstring) when loading from the database and then specify the write provider (using your write

MySQL c# Connection String failover

十年热恋 提交于 2019-12-02 10:55:59
问题 I am aware that I can seperate hosts in the connection string with a comma and it will use different servers: https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/multiple-servers/ for example: Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase; Uid=myUsername;Pwd=myPassword; But I need some information on how it specifically chooses servers. For example, is it round robin? Or does it go in order, until it finds a working one? If the first one fails,

Need Encrypted connection string and stmp information in the web.config

﹥>﹥吖頭↗ 提交于 2019-12-02 10:22:29
I want to keep encrypted connection string and stmp information in the web.config. can I store Connection String and SMTP information in web.config encrypted and where I need just decrypted and use? OR What is the point/event where i can encrypt the Connection String and SMTP and save in the web.config? (and if the changes happen in web.config in that, is existing session expired?) What is the best solution? Thanks It's easy to do with aspnet_regiis.exe - look at the pe/pd/pef and pdf options. You can also do it programmatically . It works by encrypting a specific configuration section. In

Connection String Error (error : 40)

空扰寡人 提交于 2019-12-02 09:34:40
I have installed SQL Server 2012 Express on a Windows Server 2008 Machine. The name of the machine is "THEMACHINE". While installation, I set SQL Server 2012 as "Default Instance". Now I set my connection string like this : <add name="BooksContext" providerName="System.Data.SqlClient" connectionString="Data Source=THEMACHINE;Initial Catalog=newdb; User ID=sa; Password=123456"/> But I get this exception : {"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct

can i connect to a remote SQLCe database?

◇◆丶佛笑我妖孽 提交于 2019-12-02 08:56:14
We've got an SQL Ce database on a remote machine and we're trying to get a reporting system (using custom LINQ queries) via c# to connect to the database in shared read mode. At this point we're getting an exception "There is a file sharing violation", even when the database has no other conections. Our sql connection string appears thus: using (SqlCeConnection conn = new SqlCeConnection( "Data Source=\\\\telemetry\\C$\\users\\usermetrics.sdf; File Mode=shared read;)) { conn.Open( ); // => exception here ... Is this even possible? 来源: https://stackoverflow.com/questions/7249510/can-i-connect

Microsoft.ACE.OLEDB.12.0 driver for x64 app - how to make it work with x86 MS Office installed?

让人想犯罪 __ 提交于 2019-12-02 07:56:10
问题 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: I have built x64 C# ADO.NET console application with connection string for connecting to '*.mdb': "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..." I have two PC-s A and B, both have Windows 7 x64 and identical MS Office 2013 x86 version Same exacutable will run without problem on PC-A, and not

Changing connection string dynamically

∥☆過路亽.° 提交于 2019-12-02 07:39:06
I have a scenario where i am getting dynamically generated databases. I want to create a connection string for each database. So only initial catalog parameter will be changing. Other parameters i ll get it from web config file. It is already having all entries of connection string. I want to change only initial catalog part dynamically based on database created. Please suggest is there any way to easily to do this. Use SqlConnectionStringBuilder . Set it up from the config file and change the InitialCatalog for each database. use the SqlConnectionStringBuilder class SqlConnectionStringBuilder

What will be connection string to Access database file with PHP

*爱你&永不变心* 提交于 2019-12-02 07:19:12
I installed WAMP, I have access database file in project folder, but don't have installed Access on my computer. Can I read and update Access file with PHP even I don't have installed Access? And what will be connection string to Access database file? I really need help with this. All you need is the PHP api for ODBC . Here is the example from the docs itself: <?php // Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008 $connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user,

C# extract formatted text from Excel through OLEDB

♀尐吖头ヾ 提交于 2019-12-02 06:44:11
问题 I am reading data from a large excel file which has got formatted texts. I extract the data to DataTable object through oleDBConnection & GetOleDbSchemaTable . But the extracted data doesn't include any formatted information. My requirement is, I need to extract only non-Strikethrough texts. I don't have any issues while reading and everything is perfectly fine. But my extraction should be based on text format in excel which I am unable to find the solution. Anything to be added in the