=========================================================================
TheBeerHouse Website for ASP.NET 2.0
Sample project for the Wrox Press book "ASP.NET 2.0 Website Programming",
by Marco Bellinaso
=========================================================================
This project was designed using Visual Studio 2005, and SQL Server 2005 Express Edition.
Prerequisites
You must have Visual Studio 2005, and either the Express Edition of SQL Server 2005,
or the one of the full featured editions of SQL Server 2005 loaded on your computer.
If you only have SQL Server 2000, then you can download the free Express Edition of
SQL Server 2005 - you can NOT use SQL Server 2000 with this project (unless you change a
few T-SQL stored procedures at least)
Miscellaneous Notes
1) I used the Professional Edition of Visual Studio 2005, but most features of TheBeerHouse
should also work with the Standard Edition. I think the main thing you'd miss out on with
the Standard Edition is some of the integrated SQL Server functionality, and the deployment
wizard.
2) SQL Server 2005 Express Edition comes with some Editions of Visual Studio 2005, and is
sometimes installed on your computer by default (unless you used a custom install and
told it otherwise). Unlike the Express editions of Visual Studio (which I do not
recommend for professional developers), the SQL Server 2005 Express Edition is NOT simply
an elementary learning edition. Rather, this is the replacement for the older Microsoft
Data Engine (MSDE), which was the free version of SQL Server 2000. Although MSDE had no
graphical development tools, this new express edition does have a nice graphical tool
which is a free version of SQL Server Management Studio called SQL Server Management Studio
Express. At the time of this writing it didn't come with the SQL Server 2005 Express
Edition, but can be downloaded from:
http://msdn.microsoft.com/vstudio/express/sql/default.aspx
In short, the Express Edition of SQL Server 2005 is a great choice for development purposes.
3) This new Express edition of SQL Server has a very cool new feature: it can automatically
attach to any .mdf and .ldf database files in the App_Data directory under a Visual Studio
2005 website. This makes it very easy for you to install the sample website because you
don't have to take any action to set up the database first!
4) If you decide to use a more complete edition of SQL Server 2005, instead of the Express
Edition, it will require a little more setup work. This is mentioned in the steps below.
Detailed Installation Instructions
1) Extract all the files into a local folder of your choice.
2) If you are using a non-express edition of SQL Server 2005, follow the steps in the
section below entitled "SQL Server 2005 - Non-Express Edition Setup".
3) Open the solution from Visual Studio 2005 (File | Open | Project/Solution,
or double click the .sln file from Windows Explorer).
4) You can run the site by pressing F5. This will start the integrated Web Server and
will start your Browser to view the site. If you have set FireFox, or another browser
to be your default browser, you can use an option on the File menu of VS 2005 to
select to use Internet Explorer, instead, if desired.
The sample administrator account has the following credentials:
Username: Admin
Password: admin
SQL Server 2005 - Non-Express Edition Setup
You can use the same .mdf and .ldf files that were distributed with the code download,
but you need to attach them to your SQL Server 2005 database. You also need credentials
to allow you to use the new database.
1) Copy the .mdf and .ldf files to a folder on the SQL Server computer, and name them
with a name you like. This is how I named mine:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TheBeerHouse.mdf
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TheBeerHouse_Log.ldf
2) Open SQL Server Management Studio, and start a new query, and connect to your
database instance and the master database.
3) Key in this query and press F5 to run it (use the same paths as step 1):
exec sp_attach_db @dbname=N'TheBeerHouse',
@filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TheBeerHouse.mdf',
@filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TheBeerHouse_Log.ldf'
4) Replace the query in your query window with this code and press F5 to run it - please
make changes to the user credentials first - NEVER use the same username and password
as those that come from a book or Internet site:
USE TheBeerHouse
GO
EXEC sp_addlogin 'DBuserName', 'SecretPassword', 'TheBeerHouse'
GO
EXEC sp_grantdbaccess 'DBuserName', 'DBuserName'
GO
EXEC sp_addrolemember 'db_datareader', 'DBuserName'
GO
EXEC sp_addrolemember 'db_datawriter', 'DBuserName'
GO
EXEC sp_addrolemember 'db_owner', 'DBuserName'
GO
5) Edit your connection string in web.config, located in the TBH_Web folder of the Visual
Studio project. This is a sample connection string - please edit the user credentials as
you did for step 4 above, and specify the appropriate IP address:
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=111.222.333.444;Initial Catalog=TheBeerHouse;uid=DBuserName;pwd=SecretPassword"
providerName="System.Data.SqlClient"/>
</connectionStrings>
Production Deployment
Be sure to delete the various sample accounts and related security configuration
from the Admin / Manage Users page before going to production. You also need to
remove content that you don't want to deploy, and customize the website for your
purposes. You certainly don't want to deploy the website "as is" (unless maybe
you own a pub named TheBeerHouse)!
Please refer to the book's last chapter for detailed instructions to deploy the
site to a local or remote IIS server (instead of the integrated web server), and
for steps on copying the local SQL database to a remote SQL Server.
You must always test the site using a real IIS server before you attempt to deploy
it to a production server. Similarly, you should test with a full edition of SQL
Server before deploying to production. The Internet is full of stories where people
say "it worked fine on my computer, but it doesn't work in production". You need
the experience of doing extra deployments, and you need to test with a server
environment that is similar to your production environment to ensure that there
will be no surprises when you finally deploy to production.
Check for Updates
Please check the web sites of Wrox Press, the author, and the Techncal Editor for
any errata or changes to the book or sample code after publication.
The main Wrox Press site:
http://www.wrox.com/WileyCDA/
The "P2P" programmer message forum - locate the forum for this book and post
your questions there:
http://p2p.wrox.com/default.asp?CAT_ID=23
The author's sample website:
http://www.dotnet2themax.com/TheBeerHouse/Default.aspx
The author's books page:
http://www.dotnet2themax.com/booksmarco.aspx
The author's blog:
http://www.dotnet2themax.com/blogs/mbellinaso/
The Technical Editor's website:
http://www.EricEngler.com
没有合适的资源?快使用搜索试试~ 我知道了~
微软经典asp.net源码TheBeerHouse
共1155个文件
gif:573个
js:153个
cs:119个
5星 · 超过95%的资源 需积分: 3 56 下载量 94 浏览量
2008-08-06
23:04:25
上传
评论 1
收藏 3.22MB RAR 举报
温馨提示
自己刚试过,可以运行,界面很漂亮,做为微软asp.net网站推荐的源码,自然不可小觑。<br>遇到问题及解决方法如下:<br>SQL Server 2005 用户登录失败的解决<br><br>SQLServer2005用户登录失败,报如下错误:用户 sa登录失败,该用户与可信 SQL Server 连接无关联的解决方法(sql2005下)<br><br><br>解决办法<br><br>首先说一下,如果用户是sa登陆的话,<br><br>首先选中服务器(右键)->属性->安全性->服务器身份验证修改为\"SQL SERVER和WINDOWS身份验证模式\"(这一步很重要,做完后需要重启数据库)<br>其次展开服务器上的\"安全性\"->登陆名->选中SA登陆帐号(右键)->状态->登陆修改为启用<br><br>如果用户是自己新建立的用户,比如yzksoso,则要先在数据库中创建用户,首先在服务器下面的安全性下找到登陆名,右键,新建用户名,在常规项右边栏设置Windows登陆或者是混合登陆,选择默认数据库,在用户映射里勾选我们要访问的数据库,在成员身份里至少要有owner和public的双重身份,不然会连不上。最后查看状态里面登陆是否为启用。后面的操作同前面sa登陆。
资源推荐
资源详情
资源评论
收起资源包目录
微软经典asp.net源码TheBeerHouse (1155个子文件)
fckeditor.afp 4KB
Global.asax 2KB
UserProfile.ascx 9KB
ArticleListing.ascx 6KB
ProductListing.ascx 5KB
PollBox.ascx 3KB
NewsletterBox.ascx 2KB
WelcomeBox.ascx 2KB
ShoppingCartBox.ascx 2KB
PersonalizationManager.ascx 1KB
RssReader.ascx 878B
FileUploader.ascx 484B
ThemeSelector.ascx 366B
RatingDisplay.ascx 299B
AvailabilityDisplay.ascx 200B
class_upload.asp 6KB
class_upload.asp 6KB
commands.asp 5KB
fckeditor.asp 5KB
upload.asp 3KB
connector.asp 3KB
io.asp 2KB
basexml.asp 2KB
config.asp 1KB
sampleposteddata.asp 1KB
config.asp 1KB
util.asp 1KB
io.asp 627B
ShoppingCart.aspx 15KB
AddEditArticle.aspx 12KB
AddEditProduct.aspx 11KB
ManagePolls.aspx 11KB
ShowArticle.aspx 9KB
Register.aspx 8KB
ManageDepartments.aspx 7KB
ManageCategories.aspx 7KB
ManageForums.aspx 7KB
EditOrder.aspx 6KB
ManageOrders.aspx 6KB
EditProfile.aspx 5KB
ManageShippingMethods.aspx 5KB
ManageComments.aspx 5KB
ShowThread.aspx 5KB
BrowseThreads.aspx 5KB
Contact.aspx 4KB
PasswordRecovery.aspx 4KB
ManageOrderStatuses.aspx 4KB
EditUser.aspx 4KB
ShowProduct.aspx 3KB
SendNewsletter.aspx 3KB
AddEditPost.aspx 3KB
ManageUnapprovedPosts.aspx 3KB
ArchivedPolls.aspx 3KB
ManageUsers.aspx 3KB
Default.aspx 3KB
SendingNewsletter.aspx 2KB
ShowDepartments.aspx 2KB
ShowCategories.aspx 2KB
ArchivedNewsletters.aspx 2KB
ShowForums.aspx 2KB
OrderHistory.aspx 2KB
About.aspx 2KB
Error.aspx 1KB
GetArticlesRss.aspx 1KB
AccessDenied.aspx 1KB
ManageProducts.aspx 1KB
GetThreadsRss.aspx 1KB
GetProductsRss.aspx 1KB
ManageArticles.aspx 1KB
MoveThread.aspx 988B
ShowNewsletter.aspx 867B
connector.aspx 734B
OrderCancelled.aspx 594B
OrderCompleted.aspx 593B
BrowseArticles.aspx 589B
BrowseProducts.aspx 571B
Notify.aspx 458B
Default.aspx 223B
fckeditor.cfc 7KB
connector.cfm 9KB
fckeditor.cfm 6KB
spellchecker.cfm 5KB
progress.cgi 10KB
upload.cgi 5KB
connector.cgi 3KB
header.cgi 1KB
web.config 10KB
web.config 3KB
SqlStoreProvider.cs 30KB
SqlArticlesProvider.cs 23KB
Article.cs 21KB
Post.cs 17KB
ConfigSection.cs 17KB
Newsletter.cs 17KB
SqlForumsProvider.cs 16KB
Order.cs 15KB
Product.cs 14KB
StoreProvider.cs 13KB
Comment.cs 10KB
SqlPollsProvider.cs 9KB
共 1155 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
- Pineasy2014-09-16很经典的例子!学习啦
- xyxlyq2012-09-21在学习中,希望有帮助,谢谢
- 名贤集2012-12-03好强大的代码,强
- okhui2013-05-09刚刚看了两个小时。。。感觉还不错谢谢!
- amilan2013-05-22下载后配置出了点问题,现在解决了,开始学习
poodle
- 粉丝: 23
- 资源: 89
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功