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