Solved

SQL Server Database - VS Express 2013 For Web

Posted on 2014-02-23
9
852 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

751 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