connection-string

How do i detect the provider from a user-specified connectionstring?

感情迁移 提交于 2019-12-11 04:36:27
问题 My application needs to do a certain query against a user-specified connectionstring. The query will need some parameters, so I was thinking of using the DbProviderFactory , in combination with myConnection.GetSchema("DataSourceInformation").Rows[0]["ParameterMarkerFormat"] to find out if I need to use : (Oracle), @ (Sql) or ? (OleDb) to send in the parameters to the database. To use the DbProviderFactory I need to find out what Provider is needed for a connectionstring. Is there a good way

cannot connect sql server 2008 from another computer [duplicate]

笑着哭i 提交于 2019-12-11 04:23:25
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: System.Data.SqlClient.SqlException A network-related or instance-specific error i have winform application in c# which connect to my own db and its working fine my current sql connection string is : SqlConnection con = new SqlConnection("Data Source=ITPL_PC1;Initial Catalog=Data_Project;Persist Security Info=True;user id=sa;Password=insforia"); but when i am taking this winform to another computer its not

SQLite connection strategies

我们两清 提交于 2019-12-11 03:44:32
问题 I have a database that may be on the network drive. There are two things that I want to achieve: When the first user connects to it in read-only mode (he doesn't have a read-write access to the location, or the database is read-only), other users must use the read-only connection also (even if they have RW access). When the first user connects to it in RW mode, others can not connect to the database at all. I'm using SQLite, and the concurrency should not be the problem, as the database

Do connection string DNS lookups get cached?

余生颓废 提交于 2019-12-11 03:35:45
问题 Suppose the following: I have a database set up on database.mywebsite.com , which resolves to IP 111.111.1.1 , running from a local DNS server on our network. I have countless ASP, ASP.NET and WinForms applications that use a connection string utilising database.mywebsite.com as the server name, all running from the internal network. Then the box running the database dies, and I switch over to a new box with an IP of 222.222.2.2 . So, I update the DNS for database.mywebsite.com to point to

Why am I getting an error in my ASP.NET Core SQL Server Express Connection String?

我的梦境 提交于 2019-12-11 03:12:59
问题 I've recently started a new ASP.NET Core web application and I'd like to connect it to my local SQLExpress database. I've been following the documentation but I'm getting an error of "Value cannot be null" when it tries to read my connection string at options.UseSqlServer(configuration.GetConnectionString("DefaultConnection") Here is my code so far. In Startup.cs I have the following setup: using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions

c#, oledb connection string issue

醉酒当歌 提交于 2019-12-11 03:10:05
问题 I'm using .net4.0 and c# language. In my code i have a connection string oleConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source = " + filepath + "; Extended Propertie s= \"Excel 12.0;HDR=yes\""; and it work well. But when i change a connection string like this: oleConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source =" + filepath + "; Extended Properties =\"Excel 12.0;HDR=no\""; (I change HDR parameter for "no") I got error: No value given

What is wrong with this mysql connection string?

寵の児 提交于 2019-12-11 02:32:39
问题 I am using this connection string, <add name="connectionString" connectionString="server=10.1.1.16;user id=root; password=lmslive; database=lmslive; pooling=false;" providerName="MySql.Data.MySqlClient"/> and this database lmslive is in a system next to mine connected via proxy.... And i executed this query on that system, GRANT ALL PRIVILEGES ON lmslive.* TO 'lmslive'@'10.1.1.15' IDENTIFIED BY 'lmslive' WITH GRANT OPTION; I get the error, Access denied for user 'root'@'XAVY-PANDIYA' (using

EntityFramework Connection problem

别来无恙 提交于 2019-12-11 02:29:10
问题 I have a solution in Visual Studio 2008 with 3 projects. One Web Application and 2 class libraries. The entity framework model is in a class library and the start project is the web application. I used to have this problem: "The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid." I fixed it copying the connection string from the App.config of the class library where the entity model is located to the web

net core 1 (dnx 4.5.1) with enterpriselibrary 6 - setting up the connection string

狂风中的少年 提交于 2019-12-11 02:22:07
问题 i ve big problems running enterprise library data access block with net core 1 (dnx 4.5.1) How can i setup the default connection string for entlib my appsettings.json "ConnectionString": "Server=localhost\sqlexpress;Initial Catalog=blind;User Id=blind;Password=blind" Here is my problem (no default connectionstring) Database db = DatabaseFactory.CreateDatabase(); how can i pass the appsettings ConnectionString to the entlib databasefactory any help would be greatly appreciated 回答1: I know it

Making EntityFramework Connection String dynamic

筅森魡賤 提交于 2019-12-11 02:09:51
问题 I'm using this code for connect to my database over the network : // Specify the provider name, server and database. string providerName = "System.Data.SqlClient"; string serverName = "VENUS-PC"; string databaseName = "Cheque"; // Initialize the connection string builder for the // underlying provider. SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder(); // Set the properties for the data source. sqlBuilder.DataSource = serverName; sqlBuilder.InitialCatalog = databaseName