sql-server-express

Visual Studio 2012 Code First still uses SQLEXPRESS by default

做~自己de王妃 提交于 2019-12-07 02:38:12
问题 I created a brand new Web API project, created a simple Code First model (one class with an id and the dbcontext object, and that's it), and ran Enable-Migrations in the package manager console. I noticed that it creates the database in SQLEXPRESS rather than LocalDB, despite the DefaultConnection string pointing to (LocalDB) in the Web.config file. This causes subsequent queries to fail, claiming that the database hasn't been initialized. How do I get the Enable-Migrations command in VS 2012

SQL server won't open DB created by Visual Studio

守給你的承諾、 提交于 2019-12-07 02:15:33
问题 I've built an ASP.Net site in Visual Studio, and created the DB inside it (the .mdf file is in the APP_data folder). Now, when I want to deploy in the customer site, I think about maintaining the DB without open Visual Studio, and by using the SQL Server Express tools (back up etc.). I've searched how to do this, and learned that I should attach the .mdf file to sql server. I've tried to do this and failed! The error is: Unable to open the physical file "< .mdf >". Operating system error 5:

How do I know what version of SQL Server Express my database is in?

China☆狼群 提交于 2019-12-06 17:25:59
A year ago or so I started to develop an app in Visual Studio 2013. The database was in the SQL Server Express edition. I'm just getting back to it now. I've upgraded VS to 2015 Community edition and wanted to use the DB. But I can't open it. The error I am receiving is: The Data Source value in the connection string specifies an instance of SQL Server that is not installed. To resolve this issue, you can either choose to install the matching instance of SQL Server or modify the Data Source value in the connection string. I'm trying to figure out what version the old db is in so I can install

how to execute bulk insert statement in java (using JDBC) with db=SQL Server 2008 Express

蓝咒 提交于 2019-12-06 14:32:52
I am trying to execute a BULK INSERT statement on SQL Server 2008 Express. (It basically takes all fields in a specified file and inserts these fields into appropriate columns in a table.) Given below is an example of the bulk insert statement-- BULK INSERT SalesHistory FROM 'c:\SalesHistoryText.txt' WITH (FIELDTERMINATOR = ',') Given below is the Java code I am trying to use (but its not working)...Can someone tell me what I am doing wrong here or point me to a java code sample/tutorial that uses the Bulk Insert statement? -- public void insertdata(String filename) { String path = System

Upload DBFile.mdf in App_Data to Azure

…衆ロ難τιáo~ 提交于 2019-12-06 07:50:47
I have my ASP.NET MVC 3 project with a local database stored in /App_Data directory. This db is SQLExpress file (*-mdf). I have my connection string working perfectly in my development CPU, the Connection String is: data source=.\SQLEXPRESS;initial catalog=CFCBBSecurity;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MYFILE.mdf;User instance=true" providerName="System.Data.SqlClient" When I upload it to Azure, using VS 2010, all files are in the server, but the application cannot access the Database. What should I do, change or update? Thanks in advance. The problem is that you're

SQLExpress - How do I set username/password for a sql datafile

☆樱花仙子☆ 提交于 2019-12-06 07:08:07
问题 I have a website that connects to SQLServer Express database files for Membership and data storage.So I have two .mdf files. Here are the connection strings: public static string ASPNETDB = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.mdf;Integrated Security=True;User Instance=True;User ID=;Password=; "; public static string Dok = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dok.mdf;Integrated Security=True;User Instance=True;User ID=;Password=; "; Now

What are the options available to encrypt a SQL Server Express database?

蓝咒 提交于 2019-12-06 03:03:49
We have a team of sales persons who travel often carrying a laptop loaded with Sales data in a SQL Server Express database. What are the options available to encrypt a SQL Server Express database? What's your threat model? Are you trying to stop a casual thief who's stolen a laptop, or a determined hacker? Are you trying to protect just the data, or also the schema? If you're using SQL Server Express 2005 or higher, then it supports native asymmetric encryption . But if you're trying to stop a determined hacker, then I think the best option would be to encrypt the whole disk using something

How to insert record into a sql server express database table?

放肆的年华 提交于 2019-12-06 02:16:25
I'm trying to insert a textbox value to a database table called site_list . The site_list table contains two columns id and site_name , id set to auto increment This is the code I'm trying and when it execute there is no error, but the data is not showing up in the table SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=.\\SQLExpress;" + "User Instance=true;" + "Integrated Security=true;" + "AttachDbFilename=|DataDirectory|scraper_db.mdf;"; SqlCommand addSite = new SqlCommand("INSERT INTO site_list (site_name) " + " VALUES (@site_name)", conn); addSite.Parameters

Repair/Remove/Install processes for SQL Server 2012 Express get stuck or hung

ⅰ亾dé卋堺 提交于 2019-12-05 20:19:48
问题 An instance of SQL Server 2012 Express became corrupted somehow. I suspect it was related in some way to my use of Entity Framework, but have no proof yet. When trying to repair the instance, the repair process seemed to be stuck at the SqlEngineConfigAction_repair_validation_Cpu64 step. It was at that step for a long time with no noticeable CPU usage, so I finally cancelled the repair process. When trying to remove the instance, the uninstall process seemed to hang at the

Reset PK auto increment column

醉酒当歌 提交于 2019-12-05 19:56:06
I've been importing thousands of records multiple times in an effort to get the import running perfectly. As a result, now when I do the live import before release, the ID columns for the auto increment column are on around 300,000. Is there any easy way to 'reset' this once I have deleted all the data from these tables? I only want to for SEO reasons, the URL: Forum/1/Post Forum/35/Post Forum/5600/Post Looks a lot nicer and more concise (therefore more clickable in results) than Forum/300124/Post Forum/370321/Post Forum/450111/Post I'd rather not delete the column and reinsert the column as