Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2012, 01:05 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile Use mssql 2005 in asp.net 4

Hello all,
I want to use ms sql 2005 in visual studio 2010. For this I changed the framework to 3.5 while creating new website but don;t know how it will create 2005 compatible database schema.
Please guide me.

Thanks
Reply With Quote
  #2 (permalink)  
Old July 12th, 2012, 01:37 PM
Authorized User
Points: 87, Level: 1
Points: 87, Level: 1 Points: 87, Level: 1 Points: 87, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Location: New Mexico
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

sophia, I could be misunderstanding but I'm not sure why you need to change to the 3.5 Framework in order to create a 2005-compatible database schema. The .NET Framework really has nothing to do with database schema: entirely different entities.

If you're talking about creating a project with an App_Data folder, for example, and adding a .mdf database file to your project, the version of the database will depend on what version of SQL Server Express you're currently running. For example, if you have SQL Server 2005 Express running, the database will be created in version 9 (or 2005). The .NET Framework's SQL data provider will still be able to fully interface with the database whether in v3.5 or v4.0. Happy coding!
Reply With Quote
  #3 (permalink)  
Old July 15th, 2012, 10:58 PM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Quote:
but I'm not sure why you need to change to the 3.5 Framework in order to create a 2005-compatible database schema
Hi Guenfire,
actually on my machine I have VS2010 and hence Sql server 2008 by default. But my host provider still has lower version of VS and Sql server.
That's why I changed framework to 3.5 but database schema was still 2008 compatible.
So how I can host a site on lower version which is developed on higher version?

Many thanks for your kind reply.
Reply With Quote
  #4 (permalink)  
Old July 15th, 2012, 11:58 PM
Authorized User
Points: 87, Level: 1
Points: 87, Level: 1 Points: 87, Level: 1 Points: 87, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Location: New Mexico
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Okay, I understand your issue now. You're talking about the compatibility level. If this is a database in your Visual Studio project (e.g., a .mdf file) you will have to first detach it from the project (hint: using right-click on the database), attach it to SQL Server using SQL Server Management Studio, then make the following change using SQL:

Code:
ALTER DATABASE database_name 
SET COMPATIBILITY_LEVEL = 90
If your database is separate, you can just run the above query and that will then make the database 2005 compatible. Happy coding!
Reply With Quote
  #5 (permalink)  
Old July 16th, 2012, 10:42 AM
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi guenfire,

Quote:
ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = 90
what the above code is doing? and what 90 means?
Kindly tell me what is compatibility level for ms sql 2000.

Many thanks, I will sooner try it.
Reply With Quote
  #6 (permalink)  
Old July 16th, 2012, 11:16 AM
Authorized User
Points: 87, Level: 1
Points: 87, Level: 1 Points: 87, Level: 1 Points: 87, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Location: New Mexico
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

sophia, as I already explained the code sets the database to be compatible with a schema for SQL Server 2005. This link should provide answers to most of your questions: ALTER DATABASE Compatibility Level (Transact-SQL).
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSSQL Server 2005 security Wooger SQL Server 2005 0 April 10th, 2007 05:43 AM
MSSQL 2005 and MSSQL 2000 tiredcat Visual Basic 2005 Basics 0 April 9th, 2007 12:56 AM
Full Text Search using MSSQL 2000 + ASP.net 2.0 shaileshk ADO.NET 0 February 6th, 2007 06:17 AM
Connect to MSSQL 2005 express salemkoten SQL Server 2005 2 October 11th, 2006 04:46 AM
send MASS Emails in ASP.NET 2 with VB.NET 2005 alexdcosta ASP.NET 2.0 Basics 1 July 17th, 2006 12:31 AM



All times are GMT -4. The time now is 08:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.