Solved

SQL Server Database - VS Express 2013 For Web

Posted on 2014-02-23
9
839 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
 

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now