connection-string

Find the connection-string

若如初见. 提交于 2019-12-13 02:56:59
问题 I am creating database application in VB 2008. How am i find the connection-string for that application? what are facts that i have to include in connection-string? 回答1: You don't say what database you are connecting to. You will find lots of details on a variety of databases here: http://connectionstrings.com/ Also, you would put the connection string itself into the App.config or web.config file. See also MSDN How to read connection strings from the web.config 回答2: This depends on which

Why do I get this error when I try to open an MDF database via path/filename in Entity Framework?

南楼画角 提交于 2019-12-13 02:54:25
问题 I'm migrating an application from LINQ-to-SQL to Entity Framework and have changed the line: using (var db = new MainDataContext(SystemHelpers.GetDatabaseConnectionString())) to using (var db = new MainDataEntities(SystemHelpers.GetDatabaseConnectionString())) where SystemHelpers.GetDatabaseConnectionString()) is a file path to an .mdf file . It works in LINQ-to-SQL but in Entity Framework the above line gives me this error : The format of the initialization string conflicts with the

how to solve Keyword not supported: 'data source'

此生再无相见时 提交于 2019-12-13 02:52:16
问题 I uploaded my website( that is programmed with asp.net mvc and entity framework 5 ) yesterday and wrote this connection string in the web.config file of the host root ( control panel is plesk onyx) I tried changing it to SqlCLient ,Removing some tags, and so many other things but no change it return error: keyword not supported: 'data source' when I remove data source it return keyword not supported 'initial catalog' and so on thanks for your attention <add name="ShopDBEntities"

Connect ColdFusion to SQL Server database instance

我是研究僧i 提交于 2019-12-13 02:36:27
问题 I am trying to connect to a SQL server (2008) database instance in ColdFusion 9 but there is no where to put an instance name in the CF administrator. I can get in with .net using a connection string like so: Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername; Password=myPassword; There is a place to enter a connection string in ColdFusion but I don't seem to be able to connect to the right instance (it seems to connect to the default instance). Is there a way to

How to connect to SQL Server Express using EntityFramework

谁都会走 提交于 2019-12-13 02:28:45
问题 I tried to find information about this on the web and Stack Overflow, but none of the responses could help me solving my problem. I'm working with C# and SQL Server. I'm using code from an existing project, which project connects to an SQL Server instance to manage data. This project uses EntityFramework. Now I want to use a local instance of SQL Server, precisely SQL Server Express, for development purpose. But I can't figure out how to connect to this local instance. Connecting to the

Danger of using reflection to add Connection Strings to ConfigurationManager.ConnectionString

為{幸葍}努か 提交于 2019-12-13 02:17:38
问题 I have seen several post detailing how to get around the ReadOnly barrier in adding connection strings to ConfigurationManager.ConnectionStrings. See an example of one such post below. Along of each of these examples comes a dire, yet vague warning that the technique employed is "dangerous". What is the danger? Dim cssc As ConnectionStringSettingsCollection = WebConfigurationManager.ConnectionStrings Dim t As Type = cssc.GetType().BaseType ' System.Configuration.ConfigurationElementCollection

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found,etc

人盡茶涼 提交于 2019-12-13 01:42:43
问题 I'm just publishing my website to my domain name and when I try to access it in my browser I get the Following error: 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 and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I think the problem is into my

I cannot connect to SQL Server Express using VB.NET

狂风中的少年 提交于 2019-12-13 01:25:25
问题 Can someone tell me what I am missing? I am using this connection string to connect to my database and still it won't connect: Dim str As String = "Provider = .NET Framework Data Provider for SQL Server; Data Source=C:\Users\konin\Documents\UHMS\bin\Debug\UHMS.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" This is the process I used to get the data source: right-click the database select properties and click select data source I hope I am clear enough. Thanks for reading.

mvc connection string code first

荒凉一梦 提交于 2019-12-13 01:19:14
问题 im new to mvc and im trying out some stuff with code first. im currently having problems with my dbase, whenever i build my application the build finishes successfully but i dont see my dbase get created whenever i check my local server. was wondering if there's something im missing on my connection string. <connectionStrings> <add name="mydbase" connectionString="Data Source=localhost;Database=mydbase;Trusted_Connection=yes;" providerName="System.Data.SqlClient" /> </connectionStrings> or

how to let users to select columns in a database table

不想你离开。 提交于 2019-12-13 01:14:45
问题 We are trying to build an web application that allows users to select appropriate columns for given database table. I wonder if there is any API for these - I've googled it a while in vain. Otherwise, if you can give some clues (patterns or sample codes) how to build such a component, that will be great and appreciated. 回答1: You could base your application on INFORMATION_SCHEMA views/table. This is documentation for SQL Server, but you can easily find it for other databases too: http://msdn