Vous êtes sur la page 1sur 4

Online-Songs-web-portal-asp.

net-project
This website allows registered users to upload and download .mp3 songs. It allows searching for
songs based on song title, singer and langauge.

The following are the topics of ASP.NET used in this project.

Asp.Net 3.5
C# Language

SQL Server 2005 Express Edition

Visual Studio.NET 2008

Layered Architecture with Presentation Layer and Data Access Layer

All database manipulations are done with stored procedures.

Stored procedures are accessed using classes in DAL - Data Access Layer.

ObjectDataSource is used in presentation layer to talk to DAL.

DataList is used to display and delete data

Membership and login controls are used to implement security.

Master page and themes are used

ADO.NET is used to access database

The following are the major operations in this application.


User Registration
Login

Password Recovery

Change password

Home page

Add Song

List most recently added songs

List songs of current user

Delete a song

Search for songs

Logout

Steps to download, deploy and run this project


The following are the steps to be taken to run the existing part of the application. This project
makes use of membership feature of ASP.NET.
1. Download songs.rar and unzip it into any directory in your system. For example, if you
extract to c:\ then it will create a directory c:\songs.
2. Open Visual Studio.NET 2008 or Visual Web Developer 2008.
3. Open the project from the directory into which you extracted project. For example,
c:\songs
4. Select Website->ASP.NET Configuration option
5. Select Security tab
6. Select Use the security Setup Wizard to configure security step by step.
7. Select From Internet option in Step 2
8. Click on Next button in the remaining screens and finally click on Finish.
9. It create a database called ASPNETDB.MDF with required tables and other database
components.
10. Open the database in Server explorer or Database Explorer and create tables - SONGS
with the following structure. The following tables show the structure of these tables.
SONGS
songid
title
singer
lang
addedon
userid

int
varchar(50)
varchar(100)
char(1)
datetime,
uniqueidentifier

Note
o
o

Userid is linked with userid of ASPNET_USERS table.


Songid is an identify column that starts with 1

11. Create the following stored procedure in the database.


12.
13. CREATE PROCEDURE dbo.AddSong(@title varchar(50),@singer
varchar(100),@userid uniqueidentifier,@lang char(1))

14. AS

15. insert into songs(title,singer,userid,lang,addedon) values


(@title,@singer,@userid,@lang,getdate());
RETURN @@identity;

16.
17.
18. CREATE PROCEDURE dbo.RecentlyAddedSongs
19. AS
20. select top 10 songid,title,singer,
21. lang = case lang
22.
when 'e' then 'Englsih'
23.
when 'h' then 'Hindi'
24.
else 'Telugu'
25. end,
26. addedon=convert(char(8),addedon,3), username
27. from songs s inner join aspnet_users u
28. on(s.UserId=u.UserId)
29. Order by songid desc
30.
31.
32. CREATE PROCEDURE dbo.SearchSongs (@title varchar(50),@singer
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.

varchar(100),@lang char(1))
as
if @lang='a'
select songid,title,singer,
lang=case lang
when 'e' then 'Engslish'
when 'h' then 'Hindi'
else 'Telugu'
end,
addedon=convert(char(8),addedon,3), username
from songs s inner join aspnet_users u
on (s.UserId=u.UserId)
where title like @title and singer like @singer order by songid desc
else
select songid,title,singer,
lang=case lang
when 'e' then 'English'
when 'h' then 'Hindi'
else 'Telugu'
end,
addedon=convert(char(8),addedon,3),
username from songs s inner join aspnet_users u
on (s.UserId=u.UserId)
where title like @title and singer like @singer and lang=@lang order
by songid desc

58. CREATE PROCEDURE dbo.DeleteSong(@songid int)


59. as
60. delete from songs where songid=@songid
61.
62.
63. CREATE PROCEDURE dbo.GetMySongs(@userId uniqueidentifier)
64. AS
65. select songid,title,singer,
66.
lang=case lang
67.
when 'e' then 'English'
68.
when 'h' then 'Hindi'
69.
else 'Telgu'
70.
end,
71.
addedon=convert(char(8),addedon,3)
72.
from songs
73.
where userId=@userId
74.
75. In the Application Configuration Tool, go to Application Configuration
76. Select Configure SMTP Email settings
77. Enter Server name as localhost and From as admin@systemname.com. Replace
systemname with the name of your system
78. Click on Save button
79. Go to Solution Explorer and make login.aspx the startup page.
80. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
81. You should see login.aspx page.
82. Create new user using registration page and then login with that user name
83. Test the rest of the options.

Vous aimerez peut-être aussi