connection-string

How to make sql membership provider and entity framework work using my database?

扶醉桌前 提交于 2019-12-21 20:33:32
问题 I have .NET MVC 3 project where I use sql membership provider and entity framework. I've created new database on my SQL server and created all objects for membership provider using aspnet_regsql.exe , I've changed my connection string and it works fine. Now I want to use entity framework for db interaction. I'm using Code-First so I created simple entity class and I can save data to db and retreive it. The problem is that the place where entity framework keeps it's data is a mistery. I can

How to deploy an SQL Compact Edition database file (.sdf) in the AppData folder? Connection string?

…衆ロ難τιáo~ 提交于 2019-12-21 20:26:11
问题 I'm planning to deploy my DB file in the Users\CurrentUserName\AppData folder, because default User Account Control settings restrict write access to the Program Files directory where my program is installed. First question - is this correct? So far, I've created a custom folder, set the DefaultLocation property to [LocalAppDataFolder][ProductName] , and put the .sdf file in that folder. This works in Windows 7, but it doesn't seem to work in Windows XP - I can't find any sign of it being

How can I get the connection string for an SQL Express database listed in LINQPad?

浪尽此生 提交于 2019-12-21 12:07:28
问题 Is there an easy way to get the connection string of a database listed in the connection window of LINQPad (other than using the object explorer of Visual Studio)? 回答1: Making sgmoore's comment into an answer: try this.Connection.ConnectionString.Dump(); 回答2: In LinqPad 5 if your Language dropdown is set to C# Program and you have a database selected in the Connection dropdown, then you can get your string using string c = LINQPad.Util.CurrentDataContext.Connection.ConnectionString; 来源: https

Prompt for Database Connection String

萝らか妹 提交于 2019-12-21 11:11:19
问题 I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows or a free library available on the Internet). Anybody know how to do this in .Net? EDIT: I found this and thought it was interesting: Showing a Connection String prompt in a WinForm application. This only works for SQL Server connections though. 回答1: You might want to try using SQL Server

How can I switch between 2 Connection Strings in my Web.Config (Activate one for DBML)

纵饮孤独 提交于 2019-12-21 06:43:10
问题 I have two connection strings (both in Web.Config: CS_Local and CS_Production) for my DBML (Linq to SQL). In my Global.Asax/Application_Start I run some production preparation methods if the request is non-local (!HttpContext.Current.Request.IsLocal). Within that part, I'd also like to change the current connection string used by my DBML from the standard CS_Local to CS_Production. How would I do that? Some help please.. 回答1: You can define the dbml context on the fly with: string

OracleConnection.Open is throwing ORA-12541 TNS no listener

给你一囗甜甜゛ 提交于 2019-12-21 04:25:28
问题 So I am connecting to an external server through C#. I just installed Oracle 11g client on my machine from here: http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html (255MB one). After reading many blogs/questions I found this article to be useful: http://dbaspot.com/oracle-faq/444787-ora-12541-tns-no-listener.html So is this correct? I cannot do anything. The DBA has to edit the LISTENER.ORA file? My tnsnames.ora looks like this: TestingConnect= (DESCRIPTION =

Separate ConnectionStrings and mailSettings from web.config? Possible?

梦想与她 提交于 2019-12-21 04:12:11
问题 Is it possible to separate ConnectionStrings and mailSettings from web.config? Devel environment has different IP addresses for connectionstrings and smtp mails because of development and testing. We dont want to do tests and devel using live machines and live IP addresses. Is it possible? 回答1: I found the answer on MSDN: <configuration> <connectionStrings configSource="connections.config"/> </configuration> With file connections.config containing <connectionStrings> <add name="name"

Single Connection String with Multiple Entity Framework Models?

寵の児 提交于 2019-12-20 20:18:07
问题 At work we currently have a very large web application with a connection to a massive database. We have been using Entity Framework for a while now and to make things easier we divided the database into many Entity models. This works well for us but we ran into an issue. Each EF model needs its own connection string due to the metadata part of the connection string. Managing so many connection string is a pain. Now I have a solution that I think will work. I am going to create a class that

AzureWebJobsDashboard Configuration Error

谁都会走 提交于 2019-12-20 16:24:12
问题 I created a new Azure WebJob project in Visual Studio 2015 using .NET Framework 4.6. In the app.config, I set three connection strings: AzureWebJobsDashboard AzureWebJobsStorage MyDatabaseConnectionString The AzureWebJobsDashboard and AzureWebJobsStorage connection strings are identical and they're both pointing to my storage account. I'm including one of the connection strings -- since they're both identical, except the "name". <add name="AzureWebJobsDashboard" connectionString=

winforms connection properties dialog for configuration string

梦想的初衷 提交于 2019-12-20 09:58:19
问题 Is there a way to display the connection properties dialog for connection string browsing(for database) in run time? As I want the user to be able to connect to various database using the GUI. The same one as we get in visual studio connection properties dialog. Thanks in Advance 回答1: Look for this article explaining exactly what are you looking for. What she say is the following: You will need to add a couple references to your project: OLE DB Service Component 1.0 Type Library Microsoft