sql-server-express

Why is dotnet ef not able to create a database against SQL Server Express?

早过忘川 提交于 2019-12-12 04:34:00
问题 I have gone through this ASP.Net MVC Core tutorial at: https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql. And I am able to use dotnet migrations to create the database against the localDb with this connection string in the appsettings.json file: { "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-MvcMovie-3005e0f3-42f4-4163-94cc-f794a05e8b91;Trusted_Connection=True;MultipleActiveResultSets=true" } Now I want to

Include SQL Server Express in setup project

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:46:57
问题 I create project in Visual Studio. My app use .mdf files. I created a setup project using InstallShield. On my computer where I developed my app, setup works just fine! But when I install app on another machine I get an error you need install SQL Server Express How to embed SQL Server Express into my setup project? 回答1: You need to install SQL Server on your computer, Visual Studio can not embed this. Go to https://msdn.microsoft.com/en-us/sqlserver2014express.aspx, download and install. I'm

Extract string from column sql?

半腔热情 提交于 2019-12-12 01:28:41
问题 So I have this column called MESSAGE on my LOGS Table that has every line starting like this (well, at least they all start with the word Percentage): Percentage|15/25|1%*1569ms#0ms*C:\Snapshot\Snapshot_15.jpg I need to select the string 1569ms in this case. They always come between * and #. How can I do this? SELECT SUBSTRING(MESSAGE, , ) as Duration FROM LOGS 回答1: SELECT SUBSTRING(MESSAGE, CHARINDEX('*',message)+1, CHARINDEX('#',message)-CHARINDEX('*',message)-1) as Duration FROM LOGS 回答2:

Cannot open database “MyDb” requested by the login. The login failed. Login failed for user 'My-PC\\MrD'

眉间皱痕 提交于 2019-12-12 01:15:33
问题 I have been connecting to my local database (SQL Express) fine all day from my C# console application. I have made an update, where I create a database and table from within the C# code using ADO.NET When I do this, my normal connection string fails, which is Data Source=.\\sqlexpress; Trusted_Connection=True; Initial Catalog=ThisIsMyDataBase; The error message is Cannot open database "ThisIsMyDataBase" requested by the login. The login failed.\r\nLogin failed for user 'My-PC\\MrD'. If I open

SSIS with Sql Server 2005 express

一笑奈何 提交于 2019-12-11 15:37:52
问题 Can we use SSIS with SQL Server (2005) Express as database? 回答1: SQL Server Express editions don't come with SSIS package. Please check this http://www.microsoft.com/Sqlserver/2005/en/us/compare-features.aspx One way to get around it is to build SSIS packages on Standard Edition and copy them. Here, this might be handy http://daron.yondem.com/PermaLink.aspx?guid=c44d040b-ed02-4330-a662-4cd9d6fb1bf3 cheers 来源: https://stackoverflow.com/questions/1046888/ssis-with-sql-server-2005-express

Is SQL Server Express a serviceable database for a ASP.NET MVC web application

吃可爱长大的小学妹 提交于 2019-12-11 13:49:45
问题 I am about to start building a ASP.NET MVC web application that relies on a database as it's backend (big surprise). As a student, I have access (via Dreamspark) to SQL Server 2008 Developer Edition, and with the default VS 2008 install, I have SQL Server Express 2005 installed already. Many of the examples on MVC I have seen use a local .mdf (SQL database) as their backend. My question is: Should I use a local database file for initial development and design? (SQL Server Express) or should I

How can we create a dynamic sql query to run without considering if the parameters are passed or not in c# windows forms

寵の児 提交于 2019-12-11 11:48:51
问题 I am using VS 2012 and SQL Express I am trying to build a windows forms application to search through a database in C# and it has different controls on the form which are passed as parameters to the query. The parameters in the query are not necessarily passed some times I am trying with the following code sample. SELECT a.ID AS 'DealID', a.TradeDate, c.COMPANYNAME AS 'Seller Company', a.SellCommission, h.BROKER_FULLNAME AS 'Seller Trader', j.DisplayName AS 'Seller Broker', d.COMPANYNAME AS

ASP.NET Membership Provider: Defining a foreign key to aspnet_Users.UserName

无人久伴 提交于 2019-12-11 06:49:33
问题 I'd like to setup a foreign key to a default membership table but I'm getting an error when trying to define it. I'm using the default aspnet_Users table and also my own Posts table. I'm trying to setup the tables as follows: aspnet_Users UserId (PK) uniqueidentifier UserName nvarchar(256) Posts PostID (PK) int UserName (FK -> aspnet_Users.UserName) nvarchar(256) However, when I try to set this up using the VS 2010 designer, it gives me the following error: The columns in table 'aspnet_Users'

“SQLExpress database file auto-creation error” but DefaultConnect pointing at SQL Server 2008 R2

删除回忆录丶 提交于 2019-12-11 05:42:11
问题 I am using Visual Studio 2012 to create an MVC4 Internet application. I've moved away from Entity Framework and I am now using a local install of SQL Server 2008 R2. I changed my connection string to point at my local SQL Server instance: <connectionStrings> <add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=NotesBoard;Integrated Security=SSPI;" providerName="System.Data.SqlClient" /> </connectionStrings> There are no other connection strings in my project. This

Way to obscure SQL Server database schema?

社会主义新天地 提交于 2019-12-11 05:09:01
问题 Is there any way to obscure the schema of a database on SQL Server? If I have SQL Server Express installed on a client site, is there a way to obscure the schema and data so that someone else cannot come along and learn the schema in order to extract data out of it and into another product? 回答1: This is a tricky one and may not even be 100% possible. However, there are a few tricks to setting it up: Install a new named instance of SQL server with a custom SA account (both name and password).