Solved

SQL Server Database - VS Express 2013 For Web

Posted on 2014-02-23
9
847 Views
Last Modified: 2014-02-24
Hi and Thanks,

I have looked all over the internet and it seems like there is no Database for the SQL Server, VS Express 2013 For Web,

What I am trying to do is get a sample database so I can practice writing ASP.Net Applications using database connections, on my Windows 8.1 laptop at home.

I have tried downloading the Northwind and Pubs sample database but when I try to bring it over to the SQL - VS Express it get rejected.

What I have done already is:
Right click the App_Data
Selected the Add
Selected the Add New Item
Selected SQL Server Database C#

I have downloaded the:
SQL Server 2000 Sample Databases (Folder)
From MSN

Then I want some Sample data in the Tables so:
What I do is:
Right click the .mdf database in the Server Explorer section of VS Express 2013, select the Modify Connection in the menu, change the Browser to the correct location and select the database, but it rejects the DB.

I guess I am using the wrong Sample database and need a link to the correct Sample DB.
that will work for the VS Express 2013 For Web

Thank You for any help...
0
Comment
Question by:Amour22015
  • 5
  • 4
9 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39881505
This walkthrough on MSDN should give you what you need :

http://msdn.microsoft.com/en-us/library/8b6y4c7s.aspx
0
 

Author Comment

by:Amour22015
ID: 39881510
Paul

Thanks but I already tried this and notice it says:

The .MDF database file cannot easily be converted to a format that you can use in current versions of SQL Server, so it's best to use the script to create the database.

Don't know what that means, but I tried and it was rejected.

Thanks
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39881529
You need to run the install scripts (instnwnd.sql or instpubs.sql) rather than using the mdf file in the download following the instructions in the walkthrough to replace the specified lines of the install script.

You also need to select the SQL Server option when you Add the Data Connection rather than selecting the option for SQL Server Data File.

Just tested this in Visual Studio 2013 and it does create the database successfully.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:Amour22015
ID: 39882773
Paul,

I took a copy of the instnwnd.sql script and put it into the New Query to run the script (right click on the .mdf database within the VS Express and selected New query) and I received the Messages below:

Msg 2812, Level 16, State 62, Line 24
Could not find stored procedure 'sp_dboption'.
Msg 2812, Level 16, State 62, Line 25
Could not find stored procedure 'sp_dboption'.

Looks like maybe I don't know where to run the script?

Thanks
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39882785
As section 7 of the walkthrough states you need to remove the following lines from the script :

exec sp_dboption 'Northwind','trunc. log on chkpt.','true'
exec sp_dboption 'Northwind','select into/bulkcopy','true'

and replace with :

ALTER DATABASE Northwind SET RECOVERY SIMPLE

the lines that need replacing are on line 24 of the script.
0
 

Author Comment

by:Amour22015
ID: 39882957
Paul,

It looks like I am very slow on what to do,

So the script worked great.

I noticed that there were no tables created or anything created in the database.

so it looks like this is what to do next:
but I don't understand:
You also need to select the SQL Server option when you Add the Data Connection rather than selecting the option for SQL Server Data File.

Also I currently have a Solution Explorer and Server Explorer tab(s) but I do not have a "Database Explorer" tab that I noticed on one of the videos I have been watching.

Thanks
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 39883045
Under server explorer, you have the Data Connections node. If you right click this and select Add Connection, the Add Connection dialog window will open.
Enter a Server Name of '(localdb)\v11.0' and a Database Name of 'Northwind'.

Add Connection Dialog Window
Click OK button.

Under Data Connections in Server Explorer you should now have a connection to the newly create Northwind database.

Right click the Northwind Data Connection and Select Close Connection.

Right click the Northwind Data Connection and Select New Query.

Paste the text of instnwnd.sql script into the new query window.
Replace lines 24 and 25 as previously described.

Click the Green Execute arrow in the top left hand corner of the New Query window.

You should then be able to right click the Northwind Data Connection and select refresh option and then browse down to the tables etc..

Hope that helps.
0
 

Author Comment

by:Amour22015
ID: 39883174
Paul,

I noticed that I did not have to:

Right click the Northwind Data Connection and Select Close Connection.

Right click the Northwind Data Connection and Select New Query.

Paste the text of instnwnd.sql script into the new query window.
Replace lines 24 and 25 as previously described.

Click the Green Execute arrow in the top left hand corner of the New Query window.

You should then be able to right click the Northwind Data Connection and select refresh option and then browse down to the tables etc..


It automatically created the need Table, Stored Procedures, etc

But this is what I am looking for,  
Thank You a lot for the step-by-step...
0
 

Author Closing Comment

by:Amour22015
ID: 39883179
Thanks for the help
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question