connection-string

Where to find .csdl, .ssdl, and .msl files in Entity Framework 4.0 code first?

浪子不回头ぞ 提交于 2020-05-28 22:22:39
问题 I want to run tests with Effort and to do that I need to specify a connectionstring that also contains a reference to .csdl, .ssdl , and .msl files. The (non-working) connectionstring looks like this now: <add name="SQLAzureConnection" connectionString= "metadata=res://*/Model.projectContext.csdl| res://*/Model.projectContext.ssdl|res://*/Model.projectContext.msl; provider=System.Data.SqlClient; provider connection string="Data Source=(LocalDb)\v11.0;Initial Catalog=Database_Nieuw;Integrated

SQL Server “.” Alias Not Working

穿精又带淫゛_ 提交于 2020-05-10 07:29:53
问题 I've added an alias of "." which should point to my local (named) instance, ".\SQL2008". But when I try to connect to ".", it times out. Am I missing something or is this not allowed? Aliases I've tried which do not work: (Set for both 32 and 64-bit, I've also tried leaving the port blank.) 回答1: If you are creating TCP/IP aliases you need to ensure the "SQL Server Browser" service is running. As well as checking the TCP/IP protocol is enabled for both server and client. In Sql Server

What is the point of “Initial Catalog” in a SQL Server connection string?

▼魔方 西西 提交于 2020-03-08 04:57:26
问题 Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial Catalog setting? (Apparently not, since the app I'm working on appears to work without it.) Well, then, what's it for? 回答1: If the user name that is in the connection string has access to more then one database you have to specify the database you want the connection string to connect to. If your user

What is the point of “Initial Catalog” in a SQL Server connection string?

烂漫一生 提交于 2020-03-08 04:55:29
问题 Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial Catalog setting? (Apparently not, since the app I'm working on appears to work without it.) Well, then, what's it for? 回答1: If the user name that is in the connection string has access to more then one database you have to specify the database you want the connection string to connect to. If your user

Edit zip file content in subfolder with Powershell

不想你离开。 提交于 2020-03-03 06:56:52
问题 I'm trying to update the contents of a zip file created from an Excel document. I want to replace some of the content of \zipfile\xl\connections.xml. This partial script will list the contents of the zip file: $shell_app = new-object -com shell.application $zip = “$destination\exceltemplates\Templates\Template1.xlsx.zip” $zip_file=$shell_app.NameSpace($zip) $zip_file.Items() | Select Path But every update method I've tried has generated an error. What's the next step needed to access and

Why do I have to include the “workstation id” and “application name” attributes in the Database Connection String in order to query a view properly?

混江龙づ霸主 提交于 2020-02-24 12:35:12
问题 At our workplace, we have an ASP.NET application that uses Microsoft SQL Server 2016 Web Edition Database Server for the back-end database. At first, In the ASP.NET application web.config, I configured the Database Connection String to be: Password=blahPasswordblah; Persist Security Info=True; User ID=sa; Initial Catalog=yadaDatabaseNameyada; Data Source=blahDNSServerNameblah\yadaSQLServerInstanceNameyada It seemed to connect properly. However, I noticed something strange when the code in the

How to use pg_dump with a connection uri / url?

痴心易碎 提交于 2020-02-21 07:14:25
问题 I can invoke psql like this: psql postgres://... How can I use pg_dump with a connection string in the format postgres://... ? Would be more convenient than breaking URI's into host, post, username, password. Is there syntax for this? 回答1: Apparently it's as simple as this: pg_dump postgres://username:password@ec2-00-00-100-100.eu-west-1.compute.amazonaws.com:5432/databasename I just downloaded a dump using this format. Optionally you can add -f filename to specify a local filename. 来源: https

Provider for SQL Server is not Register On Local Machine

十年热恋 提交于 2020-02-08 10:33:08
问题 I used the following code to connect C# with database string connStr = "Provider=.NET Framework Data Provider for SQL Server"+ " Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\\Database1.mdf;Integrated Security=True"; try { using (OleDbConnection conn = new OleDbConnection(connStr)) { conn.Open(); if (conn.State == ConnectionState.Open) { using (OleDbCommand cmd = new OleDbCommand(selected_querry, conn)) { cmd.CommandType = CommandType.Text; using (OleDbDataAdapter dAdapter =

Connecting to SQL server from Restful C# service

冷暖自知 提交于 2020-02-05 05:58:25
问题 I am trying to develop a restful C# service with a connection to Microsoft SQL database. From what I understand, I am supposed to do the connection to the SQL server inside the following code: using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; namespace Webserver.Models { public class WebserverContext : DbContext { public WebserverContext() : base("name=WebserverContext") { } public

How can I get a connection URL from an SQLAlchemy Engine instance?

走远了吗. 提交于 2020-02-03 08:25:28
问题 I begin a program by generating a URL object and passing it to create_engine. In a section of code far, far away I would like to find out what this engine is connected to, i.e. the connection URL. Is there an easy way to do this? Using inspect I can only see how to get the driver type. I can understand if the password component of a connection string was no longer available, but I'm hoping everything else is still available. Any ideas? 回答1: This works quite well for me: log.info("* Using DB: