Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server Database - VS Express 2013 For Web

Posted on 2014-02-23
9
Medium Priority
?
872 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
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.

 

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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

721 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