connection-string

Entity Framework: “ProviderName” in connection string required- all of the sudden?

纵然是瞬间 提交于 2019-11-28 12:01:02
We've been using Entity framework in a production environment for many months now, and just yesterday started to get errors on some machines when querying the database using our subclass of DbContext: "The connection string 'MyConnectionString' in the application's configuration file does not contain the required providerName attribute" Our problem is easily solved: I adding the "providerName="System.Data.SqlClient" to the connection string in the config files on all deployed servers and workstations. However, the mystery remains: according to the documentation : The providerName attribute is

How to use Application Data in an (App.config) connectionString

穿精又带淫゛_ 提交于 2019-11-28 11:33:37
I've got an SQL Server CE database in a project that I wan't to store somewhere in the %AppData% directory. However I can't find a way to make a reference to the Application Data path in the connection string (in the App.Config) <?xml version="1.0"?> <configuration> <configSections> </configSections> <connectionStrings> <add name="EntityConnectionString" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|ApplicationData|\Entities.sdf"" providerName="System.Data

Google Apps Script - JDBC Connection Failed

こ雲淡風輕ζ 提交于 2019-11-28 10:53:50
问题 I am attempting to open a connection from a Google Apps Spreadsheet without success, using example code from the Google Apps Developers reference (https://developers.google.com/apps-script/jdbc) function insert() { var conn = Jdbc.getConnection("jdbc:mysql://localhost:3306/test", "a", "a"); ERROR: Failed to establish a database connection. Check connection string, username and password. (line 56) I have tried replacing "localhost" with my specific IP address. I am able to connect successfully

Connection String Trouble MetaDataException

浪子不回头ぞ 提交于 2019-11-28 10:34:26
问题 I got two models in my project. When I added the second models I got this error in all account page: System.Data.MetadataException: The specified schema is not valid. Errors: (8.6): error 0040: the nclob type is not qualified with a namespace or alias. Only primitive types can be used without qualification. At line 34 of `InitializeSimpleMembershipAttribute.cs` : using (var context = new UsersContext()) Ligne 33 : { Ligne 34 : if (!context.Database.Exists()) Ligne 35 : { Ligne 36 : // Create

asp.net mvc Invalid value for key 'attachdbfilename'

删除回忆录丶 提交于 2019-11-28 10:06:50
I am currently reading Manning's "ASP.NET MVC 4 in Action" book and trying to get the first example to work. Within my test application, I built a simple Model and created some Views. I then imported "SQL Server Compact" using NuGet. When I finally try to run the application I get the following error: Invalid value for key 'attachdbfilename' This occurs on every interaction with the Database (SELECT or other CRUD operations) I am running. Any ideas? Though, I am bit late to respond to this question but I was facing the same issue and I resolved it by modifying the connection string like below

With System.Data.SQLite how do you specify a database file in the connect string using a relative path

我与影子孤独终老i 提交于 2019-11-28 10:01:58
Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...? AJ. A suggestion You could build the absolute path in the app and pass that in the connection string. So, if you know that the database file is in the database subfolder of the application folder, you could do something like this (C#): string relativePath = @"database\myfile.s3db"; string currentPath; string absolutePath; string connectionString; currentPath = System.Reflection.Assembly

Can SimpleMembership and Entity Framework share a connection string?

会有一股神秘感。 提交于 2019-11-28 09:49:17
问题 Currently when using Entity Framework and SimpleMembership I need to have 2 connection strings in web.config . The first is used when calling WebSecurity.InitializeDatabaseConnection and its a simple connection string. The other is for the edmx and contains file references and the connection string info. It means the connection string info is in the file twice. As well as duplicating information, I believe it can be an issue using azure (unconfirmed). Is there a way to reduce this to one

SQL Server connection string

耗尽温柔 提交于 2019-11-28 08:16:57
问题 I'm guessing you get hundreds of these questions, but here goes: So I'm trying to get a Honeywell Dolphin 6100 mobile device (CE5.0, .NET Compact Framework) to talk to an SQL Server Express 2008 database installed on the machine I'm developing on. I am a complete newbie to SQL Server and mobile development, and am still a little green in C# (yeah I know, jumped in the deep end here, eh? :D) So far I have: string sConnection = @"Data Source=JEZ-LAPTOP;DataBase=EMS_Main;Integrated Security=SSPI

Load csv into oleDB and force all inferred datatypes to string

时光毁灭记忆、已成空白 提交于 2019-11-28 08:10:41
问题 Im trying to load a csv file into a datatable using oledb. This is no problem but unfortunately one of the fields which looks numeric has a string value in about 3% of the fields and so is not being populated. because im converting the csv into xml i really don't care about inferring datatypes and simply need the data in a string as i can cast it later in a Linq2XMl phase. I am hoping to be able to do this in the connection string. I don't want to just copy the table, set it up with new

c# 2008 SQL Server Express Connection String

这一生的挚爱 提交于 2019-11-28 07:57:53
问题 I have a 2008 SQL Server Express installed on one of my machines and I'm attempting to establish a remote connection... when I use the MS SQL Server Management Studio I can log into the database without any problems at all (with the same credentials), but when I try to create a connection string in my C# application I get an 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