Solved

SQL Server Database - VS Express 2013 For Web

Posted on 2014-02-23
9
833 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

705 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

20 Experts available now in Live!

Get 1:1 Help Now