Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2012, 01:05 PM
Friend of Wrox
 
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
 
Old July 12th, 2012, 01:37 PM
Authorized User
 
Join Date: Jul 2012
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!
 
Old July 15th, 2012, 10:58 PM
Friend of Wrox
 
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.
 
Old July 15th, 2012, 11:58 PM
Authorized User
 
Join Date: Jul 2012
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!
 
Old July 16th, 2012, 10:42 AM
Friend of Wrox
 
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.
 
Old July 16th, 2012, 11:16 AM
Authorized User
 
Join Date: Jul 2012
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).





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





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