Free Programming Website

Free Programming Website www.sourcecodehub.com

Tuesday, August 12, 2014

MicroBlog free asp.net project with source codes

MicroBlog  free asp.net project with source codes

This web application is similar to twitter.com. It allows registered members to post updates, which are displayed to followers of the user. A user can have followers and friends (users who follow this user).
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
  • Post an update
  • List of user update
  • Delete an update
  • Finding people
  • Adding friend
  • Removing friend
  • Changing the profile of the user
  • 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 MicroBlog.rar and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\microblog.
  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:\microblog
  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 - MB_PROFILES, MB_FRIENDS, MB_UPDATES with the following structure. The following tables show the structure of these tables. MB_PROFILES
    userid          uniqueidentifier  (primary key)
    onlinebio       varchar(200)
    picturefile     varchar(20)
    followerscount  int
    friendscount    int
    updatescount    int
    
    Note : userid is linked with userid of ASPNET_USERS table.
    
    
    MB_UPDATES
    updateid        int    identify column (primary key)
    userid          uniqueidentifier
    test            varchar(140)
    timestamp       datetime
    
    Note : userid is linked with userid of ASPNET_USERS table.
    
    MB_FRIENDS
    userid          uniqueidentifier
    friendid        uniqueidentifier
    
    Note: userid is linked with userid of ASPNET_USERS table. friendid is linked with userid of ASPNET_USERS table. Both userid and friendid put together become primary key
    
  11. Create the following trigger for ASPNET_USERS table/li>
    CREATE TRIGGER trg_insert_profile_row
    ON dbo.aspnet_Users
    FOR Insert
    AS
    declare @userid uniqueidentifier
    
     /* insert a row into profiles table */
     select @userid = userid from inserted
     
     insert into mb_profiles values(@userid,'','default_profile',0,0,0);
    
    
  12. Create the following stored procedure in the database.
    CREATE PROCEDURE dbo.mb_addfriend(@userid uniqueidentifier, @friendid uniqueidentifier)
    AS
     begin tran
     begin try
     
       
       insert into mb_friends values(@userid, @friendid)
       
       update mb_profiles set friendscount = friendscount + 1
       where userid  = @userid;
       
       update mb_profiles set followerscount = followerscount + 1
       where userid = @friendid;
       
       commit tran
     end try
     begin catch
       rollback tran
       raiserror('Could Not Add Friend',16,1);
     end catch
    
    
    
    CREATE PROCEDURE dbo.mb_addupdate(@userid uniqueidentifier, @text nvarchar(140))
    as
     begin tran
     begin try
        insert into mb_updates(userid,[text],[timestamp])
        values (@userid,@text, getdate()) 
    
        update mb_profiles set updatescount = updatescount + 1
        where userid = @userid
        commit tran
    end try
    begin catch
       rollback tran
       raiserror('Could not add an update!',16,1)
    end catch
    
    
    
    CREATE PROCEDURE dbo.mb_deleteupdate(@updateid int)
    AS
    declare @userid uniqueidentifier
     begin tran
     begin try
     
       /* get userid for this update */
       select @userid = userid from mb_updates 
       where updateid = @updateid
       
       delete from mb_updates where updateid = @updateid
       
       update mb_profiles set updatescount = updatescount -1 
       where userid  = @userid;
       
       commit tran
     end try
     begin catch
       rollback tran
       raiserror('Could not delete update',16,1);
     end catch
    
    
    CREATE PROCEDURE dbo.mb_findpeople(@userid uniqueidentifier, @pattern  nvarchar(50))
    AS
       select au.userid, username, picturefile, onlinebio, followerscount, friendscount, updatescount
       from mb_profiles p inner join aspnet_users au on (au.userid=p.userid) 
       where au.userid <> @userid and  username like '%' + @pattern + '%' and 
            p.userid not in 
              ( select friendid from mb_friends
                where userid = @userid)
       
       
    
    
    CREATE PROCEDURE dbo.mb_getfriends(@userid uniqueidentifier)
    AS
       select au.userid, username, picturefile, onlinebio, followerscount 
       from mb_profiles p inner join aspnet_users au on (au.userid=p.userid) 
       where p.userid in 
              ( select friendid from mb_friends
                where userid = @userid)
       
    
    CREATE PROCEDURE dbo.mb_gettotalupdates(@userid uniqueidentifier)
    AS
    
     select picturefile,username, text, timestamp from mb_updates u inner join aspnet_users au on (u.userid = au.userid) inner join mb_profiles p on (u.userid = p.userid)
     where  u.userid = @userid 
     union
     select picturefile, username, text, timestamp from mb_updates u inner join aspnet_users au on (u.userid = au.userid) inner join mb_profiles p on (u.userid = p.userid)
     where u.userid in (select friendid from mb_friends where userid = @userid)
     order by  timestamp desc
    
    
    CREATE PROCEDURE dbo.mb_getupdates(@userid uniqueidentifier)
    AS
    
     select updateid,picturefile, username, text, timestamp 
     from mb_updates u inner join aspnet_users au on (u.userid = au.userid) 
        inner join mb_profiles p on (u.userid = p.userid)
     where  u.userid = @userid 
     order by timestamp desc
    
    
    
    
    CREATE PROCEDURE dbo.mb_getuserdetails(@userid uniqueidentifier)
    AS
    
      select onlinebio, picturefile, followerscount, friendscount, updatescount 
      from mb_profiles where userid = @userid
      
    
    
    CREATE PROCEDURE dbo.mb_removefriend(@userid uniqueidentifier, @friendid uniqueidentifier)
    AS
     begin tran
     begin try
     
       
       delete from mb_friends where userid = @userid and friendid = @friendid
       
       update mb_profiles set friendscount = friendscount - 1
       where userid  = @userid;
       
       update mb_profiles set followerscount = followerscount - 1
       where userid = @friendid;
       
       commit tran
     end try
     begin catch
       rollback tran
       raiserror('Could Not Remove Friend',16,1);
     end catch
    
    
    CREATE PROCEDURE dbo.mb_updateuserprofile(@userid uniqueidentifier,@onlinebio nvarchar(200),@picturefile nvarchar(50))
    AS
        if  @picturefile <> ''
           update mb_profiles set picturefile = @picturefile, onlinebio = @onlinebio
           where userid = @userid;
        else
           update mb_profiles set onlinebio = @onlinebio
           where userid = @userid;
    
  13. In the Application Configuration Tool, go to Application Configuration.
  14. Select Configure SMTP Email settings
  15. Enter Server name as localhost and From as admin@systemname.com. Replace systemname with the name of your system
  16. Click on Save button
  17. Go to Solution Explorer and make login.aspx the startup page.
  18. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  19. You should see login.aspx page.
  20. Create new user using registration page and then login with that user name
  21. Test the rest of the options.

Answers.com free asp.net project with source codes

Answers.com  free asp.net project with source codes

This website allows members to post questions and answers on different topics. It resembles Yahoo answers website. This application uses ASP.NET pages for presentation. ObjectDataSource is used to get data from Data Access Layer (DAL). Stored procedures are used to perform all important operations related to database in SQL Server.

The following are major activities in this application

  • User Registration
  • Login
  • Password Recovery
  • Posting question
  • Posting answer
  • Searching questions
  • Displaying details of a question
  • Displaying most recent questions
  • Displaying questions of current user
  • Changing password
  • Logout

Technologies and Products Used

  • ASP.NET 3.5
  • C# language
  • Visual Studio.NET 2008
  • SQL Server 2005 Express Edition
  • ADO.NET
  • Login controls - Membership
  • Stored procedures using T-SQL.
  • Identify columns for auto increment columns
  • Master pages and Themes
  • Navigation controls - Treeview, SiteMapPath etc.
  • DataBound controls such as GridView, FormView etc.
  • ObjectDataSource to get data from DAL and bind data to data-bound controls such as FormView and GridView.
  • Data Access Layer - DAL, to access database.

Steps to download, deploy and run this project

The following are the steps to related to be taken to run this application. This project makes use of membership feature of ASP.NET. So,we have to configure the website using ASP.NET Configuration tool as explained below.
  1. Download answers.rar and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\answers. The download contains all ASP.NET pages but it has NO DATABASE. We have to create database objects using ASP.NET configuration tool manually.
  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:\answers
  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 using the following script. Use New Query to open query window and type the following commands in SQL Pane.
    create table categories
    (  catcode  varchar(10)  primary key,
       catname varchar(50),
       catdesc  varchar(200),
       noquestions int
    )
    
    create table questions
    (   qid   int   identity primary key,
        title  varchar(100),
        question varchar(2000),
        addedon  datetime,
        catcode  varchar(10)  references categories(catcode),
        userid     uniqueidentifier  references aspnet_users(userid)
    )          
    
    create table answers
    (   aid   int   identity primary key,
        qid   int  references questions(qid),
        answer varchar(2000),
        addedon  datetime,
        userid     uniqueidentifier  references aspnet_users(userid)
    )
    
    
    insert into categories values('music','Music','Songs , Albums etc.')
    insert into categories values('sports','Sports and Games','Sports and Games')
    insert into categories values('health','Health and diet','Health, diet and excercise')
     
  11. Create the following stored procedure in the database.
    CREATE PROCEDURE dbo.AddQuestion(@userid UniqueIdentifier, @title varchar(100),@question varchar(2000), @catcode varchar(10))
    AS
     begin tran
         insert into questions (title,question, catcode,addedon, userid)
            values(@title,@question, @catcode, getdate(), @userid);
            
         update categories  set noquestions = noquestions + 1 
         where catcode = @catcode;
         
        commit tran
       
    
    CREATE PROCEDURE dbo.GetAllCategories
    AS
       select * from categories
       order by catname
       
       
    CREATE PROCEDURE dbo.GetAnswers(@qid int)
    AS
          select aid,answer, addedon, username, a.userid
      from answers a inner join aspnet_users  u on ( a.userid = u.userid)
          where  qid = @qid
          order by  aid desc 
          
          
    CREATE PROCEDURE dbo.GetQuestionDetails
    (@qid int)
    
    AS
      select qid,title,question, c.catcode, catname, addedon, username, q.userid
      from questions q inner join categories c on ( c.catcode  = q.catcode)
      inner join aspnet_users  u on ( q.userid = u.userid)
          where  qid = @qid
          
          
    CREATE PROCEDURE dbo.GetRecentQuestions
    AS
     select top 10 qid, c.catcode,catname,title,addedon 
     from  questions  q inner join categories c
     on  (q.catcode = c.catcode)
     order by  qid desc
    
    
    CREATE PROCEDURE dbo.SearchQuestions
     (@pattern varchar(100) )
    
    AS
     select qid, c.catcode,catname,title,addedon 
     from  questions  q inner join categories c
     on  (q.catcode = c.catcode)
     where  title like '%' + @pattern + '%'  or question like '%' + @pattern + '%'
     order by  qid desc
                   
    
    CREATE PROCEDURE dbo.AddAnswer
     ( @qid int, @userid uniqueidentifier, @answer varchar(2000))
    AS
     
        insert into answers (qid,userid,answer,addedon)
          values(  @qid,@userid,@answer, getdate())
    
  12. Goto Solution Explorer and make login.aspx the startup page.
  13. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  14. You should see login.aspx page.

Appointments Scheduler free asp.net project with source codes

Appointments Scheduler  free asp.net project with source codes

This is a web based application that allows registered users to store appointments in web. The first advantage with this is they can access their appointments irrespective of the physical location, once they have access to Internet. The other major advantage of this application is; it notifies users about the appointments, if users want notification. The entire application is built with .Net and used the following technologies of .Net.
  • Asp.Net 3.5
  • C# Language
  • SQL Server 2005
  • 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.
  • ObjectDataSource is used in presentation layer to talk to DAL.
  • GridView, FormView, TreeView, Calendar and other core controls are used for interface.
  • Membership and login controls are used to implement security.
  • Master page and themes are used
  • Site navigation is done using Site Map.
  • ADO.NET is used to access database
The following are the major operations in this application.
  • User Registration
  • Login
  • Password Recovery
  • Change password
  • List of upcoming appointments
  • Adding a new appointment
  • Searching for appointments
  • List of all appointments
  • List of appointments by date
  • List of users of the system
  • Deleting an existing appointment
  • Editing details of an existing appointment
  • 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. The download contains all tables and stored procedures created by us as well as Asp.net. So all that you have to do is download, unzip, open project in Visual Studio.Net and run login.aspx file. Here are the steps given below:
  1. Download appointments.rar and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\appointments.
  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:\appointments
  4. Go to Solution Explorer and make login.aspx the startup page.
  5. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  6. You should see login.aspx page.
  7. Create new user using registration page and then login with that user name
  8. Test the rest of the options.

Appointments Administrator Application

The other application that is related to this requirement is notification application, which is run for every one hour. It finds out whether there are any appointments that need notification and sends mails to concerned users. Here are the steps related to this project.
  • Create a new project using File->New -> Project. Select Visual C# as the language and Console Application as the type of the project.
  • Enter name as appointmentsadmin
  • Rename Program.cs to AppointmentsAdmin.cs and Program class to AppointmentsAdmin
  • Write the following code in Main() method of AppointmentsAdmin class
    // program assumes database ASPNETDB.MDF at  c:\appointments\app_data folder. If that is not the case, change the path in the code.
    // It expects database to have GetAppointmentsToNotify stored
    procedure, which retrieves appointments that are to be notified.
    
    using System;
    using System.Data.SqlClient;
    using System.Data;
    using System.Net.Mail;
    using System.Threading;
    
    namespace appointmentsadmin
    {
        class AppointmentsAdmin
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Sending Appointment Reminders...");
                Thread t = new Thread(SendMails);  
                t.Start();
            }
    
            public static void SendMails()
            {
                while (true)
                {
                    // connect to database
                    SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=c:\appointments\app_data\ASPNETDB.MDF;Integrated Security=True;User Instance=True");
                    try
                    {
                        con.Open();
                        SqlCommand cmd = new SqlCommand("GetAppointmentsToNotify", con);
                        cmd.CommandType = CommandType.StoredProcedure;
                        SqlDataReader dr = cmd.ExecuteReader();
                        while (dr.Read())
                        {
                            // send mail 
                            MailMessage m = new MailMessage();
                            m.To.Add(new MailAddress(dr["email"].ToString()));
                            m.From = new MailAddress("admin@classroom.com");  // change from address accordingly
                            m.Subject = "Appointment Reminder";
                            m.IsBodyHtml = true;
                            m.Body = "Hi" + dr["username"] + "<p/> This is to remind you about the following appointment.<p/>"
                                   + "Title : " + dr["title"] + "<p/>" + "Appointment Date : " + dr["appdate"] + "<p/>Admin,<br/> Appointments.Com";
                            SmtpClient server = new SmtpClient("classroom");  // change server name accordingly
                            try
                            {
                                server.Send(m);
                            }
                            catch(Exception ex)
                            {
                                Console.WriteLine("Could not send mail to " + dr["email"]);
                            }
    
                        }
                        dr.Close();
                        con.Close();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                        break;
                    }
                    Console.WriteLine("Sent reminders at : " + DateTime.Now);
                    Thread.Sleep(1000 * 60 * 60);  // 60 min
                }
            }
        }
    }
    
    
  • Build the project and run appointmentsadmin.exe file from bin\Debug directory. It starts but never ends. It sends mails for every 1 hour. It uses an exclusive thread that wakes up for every one hour and sends messages.



TimeTracker free asp.net project with source codes

TimeTracker  free asp.net project with source codes

This intranet application is used to keep track of time spent by project members on different projects. It stores details regarding users, projects and time spent by members on projects - time entries.

This application uses ASP.NET pages for presentation. ObjectDataSource is used to get data from Business Logic Layer (BLL), which in turn access Data Access Layer (DAL). Stored procedures are used to perform all important operations related to database in SQL Server.

The following are major activities in this application

  • User Registration
  • Login
  • Password Recovery
  • Creation of Project
  • Adding members to project
  • Listing projects
  • Listing users
  • Generating report regarding project
  • Logging Time entries
  • Displaying projects assigned to current user
  • Logout

Technologies and Products Used

  • ASP.NET 3.5
  • C# language
  • Visual Studio.NET 2008
  • SQL Server 2005 Express Edition
  • ADO.NET
  • Login controls - Membership
  • Stored procedures using T-SQL.
  • Identify columns for auto increment columns
  • Master pages and Themes
  • DataBound controls such as GridView, FormView etc.
  • ObjectDataSource to get data from BLL and bind data to data-bound controls such as FormView and GridView.
  • Business Logic Layer - BLL, to access DAL on one side and Object data source on the other side.
  • Data Access Layer - DAL, to access database.

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application. This project makes use of membership feature of ASP.NET. So,we have to configure the website using ASP.NET Configuration tool as explained below.
  1. Download timetracker.rar and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\timetracker. The download contains all ASP.NET pages but it has NO DATABASE. We have to create database objects using ASP.NET configuration tool manually.
  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:\timetracker
  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 - PROJECTS, PROJECT_MEMBERS and TIMEENTRY. The structure for these tables is shown below. PROJECT and PROJECT_MEMBERS tables refer to USERID column of ASPNET_USERS table, which is created by Configuration Tool.

    PROJECTS Table

    Column Name Data Type Remarks
    id int Identify Column
    title varchar(50)  
    description varchar(1000)  
    createdon datetime  
    creatorid uniqueidentifier References USERID column in ASPNET_USERS table
    estduration int  
    manager uniqueidentifier References USERID column in ASPNET_USERS table

    PROJECT_MEMEBRS table

    Column Name Data Type Remarks
    projectid int References ID column in PROJECTS table
    userid uniqueidentifier References USERID column in ASPNET_USERS table
    Note: PROJECTID and USERID together make up composite primary key for PROJECT_MEMBERS table.

    TIMEENTRY table

    Column Name Data Type Remarks
    entryid int Identify Column
    projectid int  
    userid uniqueidentifier  
    entrydate datetime  
    createdon datetime  
    duration int  
    description varchar(1000)  
    Note: PROJECTID and USERSID reference PROJECTID and USERID of PROJECT_MEMEBRS table. It is a composite foreign key.
  11. Create the following stored procedure in the database.
    CREATE PROCEDURE dbo.CreateProject(@title  varchar(50),
    @description varchar(1000),
    @creatorid uniqueidentifier,
    @estduration int,
    @managerid uniqueidentifier)
    AS
        insert into projects values(@title,
        @description,getdate(), @creatorid,@estduration,
        @managerid)
    

    CREATE PROCEDURE dbo.GetAllProjects
    AS
    select * from projects order by id;    
    
    CREATE PROCEDURE dbo.GetAllUsers
    AS
    select  u.userid, u.username, m.email, m.createdate
    from   aspnet_users  u  join  aspnet_membership m
    on ( u.userid = m.userid)
    order by u.username
    

    CREATE PROCEDURE dbo.GetNonMembersOfProject(@projectid int)
    AS
    
     select userid, username from aspnet_users
     where  userid not in (
     select userid from project_members
     where projectid = @projectid)
     
    

    CREATE PROCEDURE dbo.GetProjectDetails
    (@projectid int)
    AS
      select p.id, p.title, p.description, p.createdon,
      p.estduration,  u.username
      from projects p  inner join  aspnet_users u
      on (p.managerid = u.userid) 
      where  p.id = @projectid       
    

    CREATE PROCEDURE dbo.GetProjectMembers(@projectid int)
    AS
     select userid, username
     from aspnet_users
     where userid  in 
       (select userid from  project_members
        where projectid = @projectid);
    

    CREATE PROCEDURE dbo.GetTimeEntriesByProject
     (@projectid int)
    AS
       select  t.entryid, t.entrydate, t.duration, t.description, t.createdon, u.username 
       from  timeentry t inner join aspnet_users u
       on ( t.userid = u.userid)
       where  t.projectid  = @projectid
    
    

    CREATE PROCEDURE dbo.AddMemberToProject(@projectid int, @userid uniqueidentifier)
    AS
       insert into project_members values(@projectid, @userid);
       
    
    CREATE PROCEDURE dbo.AddTimeEntry(@projectid int,@userid uniqueidentifier,@entrydate datetime,@duration int,@description varchar(1000))
    AS
      insert into timeentry values(@projectid,@userid,
      @entrydate, getdate(), @duration,@description)
       
    
  12. Goto Solution Explorer and make login.aspx the startup page.
  13. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  14. You should see login.aspx page.

Website to store photos - Photos.Com free asp.net project with source codes

Website to store photos - Photos.Com  free asp.net project with source codes

This website allows users to create web albums and upload photos into albums. It was developed using ASP.NET 3.5 and SQL Server 2005 express edition as the back-end. Code is written in C#.

This application uses ASP.NET pages for presentation. ObjectDataSource is used to get data from Data Access Layer (DAL) and bind data to ListView.  It uses membership for membership related operations such as registration, login etc.

The following are major activities in this application.

  • User Registration
  • Login
  • Change Password
  • Password Recovery
  • Creation of Album
  • Uploading photos into album
  • Showing photos of an album
  • Deletion of album
  • Showing a photo
  • Editing photo details
  • Deleting photo
  • Search for photos based on title or tags
  • Share album with friends

Technologies and Products Used

  • ASP.NET 3.5
  • C# language
  • Visual Studio.NET 2008
  • SQL Server 2005 Express Edition
  • ADO.NET
  • Login controls - Membership
  • Stored procedures.
  • Identify columns for auto increment columns
  • Master pages and Themes
  • FormView, ListView and DataPager controls
  • ObjectDataSource to get data from DAL and bind data to data-bound controls such as FormView and ListView.
  • Data Access Layer - DAL, to access database.

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application. This project makes use of membership feature of ASP.NET. So,we have to configure the website using ASP.NET Configuration tool as explained below.
  1. Download photos.zip and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\photos. The download contains all ASP.NET pages but it has NO DATABASE. We have to create database objects using ASP.NET configuration tool manually.
  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:\photos
  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 - ALBUMS and PHOTOS. The structure is shown in the picture below. ASPNET_USERS table is already created by ASP.NET. The rest of the tables are to be created. AID in ALBUMS table and PHOTOID in PHOTOS table are identity columns.
    Following diagram shows the tables used in the application. ASPNET_USERS is a table created by membership of ASP.NET. You have to create ALBUMS and PHOTOS.
    Before you create these tables, create a unique index on USERNAME column of ASPNET_USERS table so that it can be used as parent key from ALBUMS table.
  11. Create the following stored procedure in the database.
    CREATE PROCEDURE dbo.CreateAlbum
    (
     @username nvarchar(256),
     @title varchar(256), @description varchar(1000) 
    )
    AS
       insert into albums (username,title,description,createdon)
          values(@username,@title,@description, getdate())
    
    
    CREATE PROCEDURE dbo.Get_Album_Details
    (
    @aid int
    )
    AS
     select a.aid,a.title,a.description,createdon, 
           count(photoid) nophotos, 
           isnull(min(photoid),0) firstphoto
     from  albums a left outer join   photos p
     on  a.aid = p.aid  
     where  @aid = a.aid
     group by a.aid,a.title,a.description, a.createdon
     
    
    CREATE PROCEDURE dbo.GetAlbums 
    (
    @username nvarchar(256)
    )
    AS
     select a.aid,a.title,a.description, 
            count(photoid) nophotos, 
            isnull(min(photoid),0) firstphoto
     from  albums a left outer join   photos p
     on  a.aid = p.aid
     where  @username = a.username
     group by a.aid,a.title,a.description
    
    
    
    CREATE Procedure AddPhoto 
    (
    @aid int,
    @filename varchar(100), 
    @title varchar(200), 
    @tags varchar(100),
    @photoid int output
    ) 
    AS
      insert into photos values(@filename,@title,@tags,getdate(),@aid);
      select @photoid =  @@identity;
      
    
    CREATE PROCEDURE dbo.DeleteAlbum
    (
     @aid int
    )
    AS
       begin tran
       
       delete from photos where aid = @aid;
       
       if @@error <> 0 
         begin
            rollback transaction
            raiserror('Could not delete photos from album',15,1);
            return;
         end;
    
       
       delete from albums where aid = @aid;
       
       if @@error <> 0 
         begin
            rollback transaction
            raiserror('Could not delete album',15,1);
            return;
         end;
      
     
       commit transaction;
       
       
     
    CREATE PROCEDURE dbo.Get_Photo_Details
    (
    @photoid int
    )
    AS
      select  title,tags,addedon from photos
      where photoid = @photoid;
      
    
    
    
    CREATE PROCEDURE dbo.GetPhotoIds
    (
    @aid int
    )
    AS
      select photoid from photos where aid = @aid;
    
    
    CREATE PROCEDURE dbo.GetPhotosFromAlbum
    (
    @aid int
    )
    AS
      select  photoid, title, tags, addedon 
      from  photos
      where aid = @aid
      order by photoid
    
    
    CREATE PROCEDURE dbo.SearchForPhotos
    (
    @pattern varchar(100)
    )
    AS
      select * from photos
      where  title like '%' + @pattern + '%' or tags like '%' + @pattern + '%'
      order by aid desc, photoid desc
    
    
  12. Goto Solution Explorer and make login.aspx the startup page.
  13. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  14. You should see login.aspx page.

Social Networking Website - Friends.Com free asp.net project with source codes

Social Networking Website - Friends.Com  free asp.net project with source codes

This website allows users to register, add other members as friends and create and join communitites. It provides scrapbook for each user and other typical features like change profile, change password etc. The following are major activities in this application.
  • User registration
  • Login
  • Change password
  • Forgot password
  • Edit profile
  • Change photo
  • Search for Friends
  • Add a user as friends
  • Viewing scrapbook
  • Sending message to other user
  • Creating communities
  • Search for communities
  • Joinging other communities

Technologies and Products Used

  • ASP.NET 3.5
  • C# language
  • Visual Studio.NET 2008
  • SQL Server 2005 Express Edition
  • ADO.NET
  • Login controls - Membership
  • Stored procedures and trigger
  • Master pages and Themes
  • Gridview, DetailsView, FormView, DataList and SqlDataSource controls
  • ListView control

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application. This project makes use of membership feature of ASP.NET.So, we have to configure the website using ASP.NET Configuration tool as explained below.
  1. Download friends.zip and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\friends. The download contains all ASP.NET pages but it has NO DATABASE. We have to create database objects using ASP.NET configuration tool manually.
  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:\friends
  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 - USER_PROFILE, COMMUNITIES, COMMUNITY_USERS, FRIENDS and SCRAPBOOK. The structure is shown in the picture below. ASPNET_USERS table is already created by ASP.NET. The rest of the tables are to be created. Column MSGID in SCRAPBOOK and COMMID in COMMUNITIES are identity columns.
  11. While creating table make sure you define Foreign keys as follows.
    Child Table and Foregin Key Parent Table and Parent Key
    USER_PROFILE - USERID ASPNET_USERS - USERID
    FRIENDS - USERID ASPNET_USERS - USERID
    FRIENDS - FRIENDID ASPNET_USERS - USERID
    SCRAPBOOK - SENDERID ASPNET_USERS - USERID
    SCRAPBOOK - RECEIVERID ASPNET_USERS - USERID
    COMMUNITIES - OWNERID ASPNET_USERS - USERID
    COMMUNITY_USERS - USERID ASPNET_USERS - USERID
    COMMUNITY_USERS - COMMID COMMUNITIES - COMMID
  12. Create the following triggers and stored procedure in the database.
    CREATE TRIGGER Trg_insert_row_into_user_profile
    ON dbo.aspnet_Users
    FOR  INSERT
    AS
     declare @userid  uniqueidentifier
     select @userid = userid  from inserted
    
     insert into user_profile 
        values( @userid, null,null,null,null)
    
    

    CREATE PROCEDURE dbo.DeleteCommunity(@commid int)
    AS
      begin tran
         delete from community_users where commid = @commid;
         delete from communities where commid = @commid;
      commit tran
    
    

    CREATE PROCEDURE dbo.GetFriends(@userid as varchar(50))
    AS
     select  u.userid,u.username,fullname
     from aspnet_users u join  user_profile up
     on  u.userid = up.userid
     where u.userid in (
       select friendid from friends
       where  userid = convert(uniqueidentifier,@userid) );
    

       
    CREATE PROCEDURE dbo.GetMessages(@userid as varchar(50))
    AS
     select  msgid,userid,username, message, senton
     from aspnet_users u join scrapbook s
     on  u.userid = s.senderid
     where  s.receiverid = @userid
    

    CREATE PROCEDURE dbo.GetUserDetails(@userid varchar(50))
    AS
      select u.userid, username, fullname, occupation, 
          gender = case gender 
            when  'm' then 'Male'
            else 'Female'
           end,
          dob = convert(varchar(10), dob, 3)
      from  user_profile up join aspnet_users  u
      on  up.userid = u.userid
      where   u.userid = convert(uniqueidentifier,@userid);
    

    CREATE PROCEDURE dbo.SearchFriends(@name as varchar(30))
    AS
     select  u.userid,username,fullname 
     from  aspnet_users u join  user_profile up
     on  u.userid = up.userid
     where  username like '%' +  @name + '%' 
       or  fullname like '%' + @name + '%';
     
    

    CREATE PROCEDURE dbo.SendMessage(@fromuserid uniqueidentifier,@touserid uniqueidentifier,
     @text varchar(2000) )
    AS
        insert into scrapbook
           values(@fromuserid,@touserid,@text,getdate());
           
    
  13. Goto Solution Explorer and make login.aspx the startup page.
  14. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  15. You should see login.aspx page.

Internet Banking free asp.net project with source codes


Internet Banking  free asp.net project with source codes

This web application provides Internet Banking facility to customers of a Bank. First an account holder must register for Internet Banking facility at the branch where he/she holds an account. Then bank provides password using which he/she can access Internet Banking facility.
This project doesn't use ADO.NET and instead it uses LINQ to access SQL Database. It also uses LINQ with stored procedures and LINQDataSource.
The following are important characteristics of this project:
  • User logs in using account number and password provided by bank
  • User can change password
  • User gets summary of Account - current balance
  • Most recent 5 transaction done by the account
  • Funds can be tranfered to other accounts of the same bank
  • Funds can be tranfered only to registered payees, so payees are to be registered
  • Search for transactions based on dates
  • Make a request for cheque book

Technologies and Products Used

  • ASP.NET 3.5
  • C# language
  • Visual Studio.NET 2008
  • AJAX
  • LINQ
  • SQL Server 2005 Express Edition
  • Security
  • Stored procedurs

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download ibank.zip and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\ibank. This download contains all that is required for project including database. Note: This project uses Ajax Control Toolkit, but it doesn't provide the AjaxControlToolkit.dll. So make sure you place AjaxControlToolkit.dll in BIN folder of the project.
  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:\ibank
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from Visual Studio.NET 2008 or Visual Web Developer 2008.
  6. You should see login.aspx page.

Knowledge Management System free asp.net project with source codes

Knowledge Management System  free asp.net project with source codes

This web application is aimed to allow students in a college or employees in an office to share there knowledge by uploading documents such as PDFs, PPTs etc. The following are major activities in this application.
  • User registration
  • Login
  • Change password
  • Forgot password
  • Adding a post
  • Editing and deleting posts
  • Searching for posts
  • Providing rating for an existing post
  • Viewing details of a post and downloading it

Technologies and Products Used

  • ASP.NET 2.0
  • C# language
  • Visual Studio.NET 2005
  • SQL Server 2005 Express Edition
  • ADO.NET
  • Login controls
  • Stored procedures
  • Site navigation - Treeview, Sitemap etc.
  • Master pages and Themes
  • Gridview and SqlDataSource controls

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application. This project makes use of membership feature of ASP.NET.So, we have to configure the website using ASP.NET Configuration tool as explained below.
  1. Download kms.zip and unzip it into any directory in your system. For example, if you extract to c:\ then it will create a directory c:\kms. The download contains all asp.net pages but it has NO DATABASE. We have to create database objects using ASP.NET configuration tool as well as manually.
  2. Open Visual Studio.NET 2005 or Visual Web Developer 2005.
  3. Open the project from the directory into which you extracted project.For example, c:\kms
  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. Create a new user in Step 5
  9. Click on Next button in the remaining screens and finally click on Finish.
  10. It create a database called ASPNETDB.MDF with required tables and other database components
  11. Open the database in Server explorer or Database Explorer and create tables - KMS_CATEGORIES and KMS_POSTS. The structure is shown in the picture below. ASPNET_USERS table is already created by ASP.NET. It is shown as it is parent table for KMS_POSTS.
    Create the following stored procedure in the database.
    CREATE PROCEDURE dbo.RecentTenPosts
    AS
       select  top 10 pid, title, description, cid, cname,filename,
       case filename 
        when '' then null
        else ltrim(str(pid,5) + '_' + filename)  end  as PhysicalFilename,
        postedon, postedby , username, Rating = (excellent * 5 + good * 4 + average * 2 + poor * 1)
                     / case excellent + good + average  + poor
                        when 0 then 1
                        else   excellent + good + average + poor
                       end 
        from  kms_posts p inner join kms_categories c
        on  p.category = c.cid  inner join aspnet_users u
        on  p.postedby = u.userid
        order by pid desc
    
  12. Goto Solution Explorer and make login.aspx the startup page.
  13. Run project from Visual Studio.NET 2005 or Visual Web Developer 2005.
  14. You should see login.aspx page.

Patients Information System free asp.net project with source codes


Patients Information System  free asp.net project with source codes

This application allows a Doctor to keep track of his/her patients. It allows Front-office /Doctor to enter the details of patients, visit details, drugs prescribed and test conducted. This application allows Front-office to enter details of drugs and test into database.
Doctor can query patients by name and they get details regarding the patients.
Doctor can get visits history of patients. Doctor can also retrieve drugs used and tests conducted for each visit.

Technologies and Products Used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download pis.zip and unzip it into any directory in your system. For example, if you extract to d:\ then it will create a directory d:\pis. This download contains all that is required for project including database.
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\pis
  4. Goto Solution Explorer and make default.aspx the startup page.
  5. Run project from VWD 2005 Express Edition or Visual Studio.NET 2005.
  6. You should see default.aspx page.

ShareBooks.com free asp.net project with source codes


ShareBooks.com  free asp.net project with source codes

This is an internet website, which allows users to share ebooks that they have with users of the website.
Users must register to upload books. However, users can browse, search and download books without any registration or login.
It allows users to rate books to provide feedback about books to other users.
It provides typical user related operations like login,change password, register, forgot password etc.
It also provides a web service, which provides details of books and users to other business associates.

Technologies and Products used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition
  • Mail Server - CMail Server

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download ShareBooks.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\ShareBooks)
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\sharebooks
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from VWD 2005 Express Edition.
  6. You should see login.aspx page.

YourBlogs.com free asp.net project with source codes


YourBlogs.com  free asp.net project with source codes

This is a website that allows users to read and post their blogs. Only registered users can post blogs. Blogs can be deleted and modified by users. Unregistered users are allowed to search, read and comment on the blogs.
Regular features related to users like login, change password, change profile etc. are provided.

Technologies and Products used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition
  • Mail Server - CMail Server

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download yourblogs.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\yourblogs)
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\yourblogs
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from VWD 2005 Express Edition.
  6. You should see login.aspx page.

BriefCase free asp.net project with source codes

BriefCase  free asp.net project with source codes

This application allows registered users to upload files into server, so that they can access them from anywhere. It allows users to create folders and add files to folders. This resembles Yahoo Briefcase.

This project is developed using ASP.NET 2.0, SQL Server 2005 express edition, CMail Server, Visual Web Developer Express Edition. The language used for coding is C#. The following topics of ASP.NET 2.0 are used in this application:
  • Membership
  • Data sources
  • Site navigation controls like TreeView and SiteMapPath
  • GridView, DetailsView, DataList etc.
  • Themes with skin and stylesheet and master page
  • Security to allow access to only to authenticated users
  • ADO.NET
  • Web.sitemap to provide site map
  • Fileupload control
  • Stored procedures
  • web.cofig with ConnectionString and Location tags (apart from security tags)
  • Session variable to keep track of current user
The following is the structure of tables to be created. However ASPNET_USERS table is already created as part of Configuring the application using ASP.NET Website Administration Tool. So you have to create only FOLDERS and FILES tables.

Steps to download and run the project

  1. Download briefcase.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\briefcase)
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\briefcase
  4. Select Website -> ASP.NET Configuration
  5. In ASP.NET Web site adminstration tool select Security Tab
  6. Click on Use the security Setup Wizard to configure security step by step
  7. Click on Next in step 1
  8. Select  From the internet  in step2 and click on Next
  9. Click Next in step3 and step4 to go to step5
  10. Provide details of new users
  11. In step6 the settings are already configured as we have a preconfigured web.config file in the project.
  12. Click on Next and then on Finish.
  13. At this stage you must see ASPNETDB.MDF in  App_Data folder of your project.
  14. ASPNETDB.MDF contains ASPNET_USERS table and other tables. So, we still need to create FOLDERS and FILES tables.
  15. Create the stored procedure as shown below:
  16. CREATE PROCEDURE dbo.AddFolder
     (
     @fname varchar(50),
     @fdesc varchar(300),
     @userid uniqueidentifier
        )
    AS
      insert into folders (fname,fdesc,userid,createdon) 
      values (@fname,@fdesc,@userid,getdate())  
  17. Goto Solution Explorer and make login.aspx the startup page.
  18. Run project from VWD 2005 Express Edition.
  19. You should see login.aspx page.

Forums free asp.net project with source codes


Forums  free asp.net project with source codes

This is a typical forums which allows users to add threads and reply to existing threads. It also allows users to search for existing threads. It provides all common tasks related to users such as registration, password recovery, change profile etc.

Technologies and Products used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download forums_sep_2007.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\). This download contains all that is required for project including database. However, images related to users must be uploaded using Change Profile option.
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\forums
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from VWD 2005 Express Edition.
  6. You should see login.aspx page.

Online Attendance free asp.net project with source codes


Online Attendance  free asp.net project with source codes

This application is used by faculty in the class to take attendance of the students. A faculty logins into the system and gets his/her time table. He/she can take attendance for a period by clicking on the attendance link on the right of the period in the time table.
This application also provides faculty the facility to search for student by name and get and modify attendance that he/she has already taken.
I suggest you add two more modules to this application, one to provide attendance details to parents of the students and another for adminstration staff to feed details regarding students, batch schedule etc.

Technologies and Products used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download attendance.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\)
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\attendance
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from VWD 2005 Express Edition.
  6. You should see login.aspx page.

Forums free asp.net project with source codes


Forums  free asp.net project with source codes

This is a typical forums which allows users to add threads and reply to existing threads. It also allows users to search for existing threads. It provides all common tasks related to users such as registration, password recovery, change profile etc.

Technologies and Products used

  • ASP.NET 2.0
  • C# language
  • Visual Web Developer 2005 Express Edition
  • SQL Server 2005 Express Edition

Steps to download, deploy and run this project

The following are the steps to related to be taken to run the existing part of the application:
  1. Download forums_sep_2007.ZIP and unzip it into any directory in your system. (For example if you extract to d:\ then it will create a directory d:\). This download contains all that is required for project including database. However, images related to users must be uploaded using Change Profile option.
  2. Open Visual Web Developer 2005 Express Edition or Visual Studio.NET 2005.
  3. Open the project from the directory into which you extracted project.For example, d:\forums
  4. Goto Solution Explorer and make login.aspx the startup page.
  5. Run project from VWD 2005 Express Edition.
  6. You should see login.aspx page.