connection-string

Pre-login handshake woes with connecting directly to SQL Azure

南楼画角 提交于 2019-11-30 13:28:00
We are currently experiencing a rather troublesome problem in our development environment with the following message... A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value.) ...the commonly accepted wisdom to resolving this problem is to set the TrustServerCertificate portion of the connection to True . However, this does not work reliably or consistently. This particular error occurs in a number of instances, for instance testing our

Changing dataset connection string at runtime

孤街浪徒 提交于 2019-11-30 12:54:03
I have a c# generated dataset. How can I change the connection string so I can use the dataset with another (identically structured yet differently populated) database? This has to occur at runtime as I do not know the server or database name at compile time. I am using c# 2.0. You can modify a single instance of the table adapter. _myAdapter.Connection.ConnectionString = connectionString; Based on the link above, I did it this way: partial class QueriesTableAdapter { public QueriesTableAdapter(string connectionString) { Properties.Settings.Default["connectionString"] = connectionString; } }

What's the Option=N in the MySQL ODBC connection string?

女生的网名这么多〃 提交于 2019-11-30 11:51:02
I have seen both Option=3 and Option=4 in connection string samples for MySQL ODBC but no explanation or documentation. What do those numbers mean? scatman The Option= value is the sum of the numeric values for various flags that specify how Connector/ODBC should work. Its default value is 0. From an older version of the Connector/ODBC documentation at web.archive.org : Option=3; corresponded to FLAG_FIELD_LENGTH (1) + FLAG_FOUND_ROWS (2) Option=4; was FLAG_DEBUG According to the current list of Connector/ODBC options here ... Table 5.2 Connector/ODBC Option Parameters ... both FLAG_FIELD

Entity Framework connection string not from config

不羁岁月 提交于 2019-11-30 10:39:52
问题 public class Context : DbContext { public Context(string connString) : base(connString) { Database.SetInitializer(new MyContextInitializer()); } //... Need to pass a connection string to the context constructor. How should the string look like, for example, for SQL Compact? Tried this, but no success: Context db = new Context("Provider=System.Data.SqlServerCe.4.0;Data Source=D:\\Context.sdf"); Edit: If I try this string: "Data Source=D:\\Context.sdf" System.Data.ProviderIncompatibleException

How to increase time in web.config for executing sql query

江枫思渺然 提交于 2019-11-30 09:09:39
When I am running a query in web application, I'm getting a null value. Same query directly in SQL Management Studio returns results. I think that the problem is a timeout. How can I increase the time for execution of query in web application? In my web.config : connectionstring , there is no code for timeout. If I choose a timeout there, will that affect other parts of my system? You can do one thing. In the AppSettings.config (create one if doesn't exist), create a key value pair. In the Code pull the value and convert it to Int32 and assign it to command.TimeOut. like:- In appsettings

Stop LINQ to SQL dbml from updating connection string when I drag tables into the dbml file

这一生的挚爱 提交于 2019-11-30 09:01:07
Every time I drag a modified table into my dbml, VS2010 wants me to update the connection string even though I have created a data connection with the exact same information. Every time this happens it changes my connection string to 'DataSourceConnectionString' and I have to delete it from 5 different files and replace it with the name of the connection string I was using previously so it doesn't screw up everyone else using the file through source control. Any Ideas? I figured out another away after tinkering with answers to some somewhat related issues. To solve the problem I was having I

How to check for the existence of a DB?

房东的猫 提交于 2019-11-30 08:45:35
问题 I am wondering if there is an elegant way to check for the existence of a DB? In brief, how do test the connection of a db connection string? Thanks 回答1: Set the Initial Catalog=master in the connection string and execute: select count(*) from sysdatabases where name = @name with @name set to the name of the database. If you want to check the connection string as a whole (and not existence of an independent database), try connecting to it in a try/catch block. 回答2: You could just try

Microsoft.ACE.OLEDB.12.0 CSV ConnectionString

偶尔善良 提交于 2019-11-30 08:23:58
问题 I know questions this kind are asked from time to time but i can't find any satisfying solution. How can I open a CSV-File using MS ACE OLEDB 12? I try it with the following code. DbConnection connection = new OleDbConnection(); connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Documents;Extended Properties=\"Text;HDR=Yes\""; connection.Open(); DbCommand cmd; cmd = connection.CreateCommand(); cmd.CommandText = "SELECT * FROM [Mappe1#csv]"; DbDataReader reader =

Multiple SQL Server connection strings in app.config file

依然范特西╮ 提交于 2019-11-30 08:09:57
问题 I'm interested in displaying in a Windows Forms app a list of N radio buttons for the user to choose a target database server. I would like to add the SQL Server connection strings in the app.config file, so they are read by the app at runtime and rendered in the windows form as radio buttons. At first I thought of using a delimiter to separate the connections <appSettings> <add key="ConnectionString" value="connection1|user id=user;password=123;server=10.0.0.1;database=myDatabase;connection

How i can use the connectionString of the current website for log4Net instead of configuring [duplicate]

吃可爱长大的小学妹 提交于 2019-11-30 07:59:01
This question already has an answer here: Can you pull the connectionString for a log4net AdoNetAppender from elsewhere in a web.config file? 5 answers I use log4Net for my system's log. The connectionString node is mandatory if the appender type is the AdoNetAppender in Log4Net. However, I already have a connectionString in my website where I use Log4Net. How can I use the connStr of the website for log4Net instead of configuring the same connstr again in the log4net config file? gustavodidomenico It's quite simple, you just need to replace the appender connectionString configuration. In