Songs.Com free asp.net project with source codes
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.
- 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.
- Open Visual Studio.NET 2008 or Visual Web Developer 2008.
- Open the project from the directory into which you extracted project. For example, c:\songs
- Select Website->ASP.NET Configuration option
- Select Security tab
- Select Use the security Setup Wizard to configure security step by step.
- Select From Internet option in Step 2
- Click on Next button in the remaining screens and finally click on Finish.
- It create a database called ASPNETDB.MDF with required tables and other database components.
- 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 int
title varchar(50)
singer varchar(100)
lang char(1)
addedon datetime,
userid uniqueidentifier
Note
- Userid is linked with userid of ASPNET_USERS table.
- Songid is an identify column that starts with 1
- Create the following stored procedure in the database.
CREATE PROCEDURE dbo.AddSong(@title varchar(50),@singer varchar(100),@userid uniqueidentifier,@lang char(1))
AS
insert into songs(title,singer,userid,lang,addedon) values (@title,@singer,@userid,@lang,getdate());
RETURN @@identity;
CREATE PROCEDURE dbo.RecentlyAddedSongs
AS
select top 10 songid,title,singer,
lang = case lang
when 'e' then 'Englsih'
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)
Order by songid desc
CREATE PROCEDURE dbo.SearchSongs (@title varchar(50),@singer 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
CREATE PROCEDURE dbo.DeleteSong(@songid int)
as
delete from songs where songid=@songid
CREATE PROCEDURE dbo.GetMySongs(@userId uniqueidentifier)
AS
select songid,title,singer,
lang=case lang
when 'e' then 'English'
when 'h' then 'Hindi'
else 'Telgu'
end,
addedon=convert(char(8),addedon,3)
from songs
where userId=@userId
- In the Application Configuration Tool, go to Application Configuration
- Select Configure SMTP Email settings
- Enter Server name as localhost and From as admin@systemname.com. Replace systemname with the name of your system
- Click on Save button
- Go to Solution Explorer and make login.aspx the startup page.
- Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
- You should see login.aspx page.
- Create new user using registration page and then login with that user name
- Test the rest of the options.