Thursday, 27 December 2012

How to Install and Uninstall Silverlight


How to Install and Uninstall Silverlight


How to Install Silverlight

Here are the steps to Install silverlight
2. Open GET STARTED Page by clicking it.
3. Find out Download Silverlight Link (If already Silverlight is installed in your machine this link will not be appeared to you).
4 If you click on Download Silverlight Link, It opens Microsoft Silverlight Install Pagehttp://www.microsoft.com/silverlight/install.aspx .
5. Click on Install Now Option then you can download the Silverlight Plug-in.
5. Then Install Silverlight By using downloaded silverlight plug-in installable setup software.
6. While Installing Silverlight you can see the progress screen as bellow.
7. Restart all of your browsers
This silverlight installation can work for all the browsers like Internet Explorer, Mozilla, Opera.....

How to uninstall Silverlight

Bellow are the steps to follow to uninstall the silverlight
1. Go to Start menu.
2. Go to Control Panel
3. Open Add or Remove programs.
4. Choose Microsoft Silverlight in Add Remove Programs Dialog box.
5. Click on Remove
6. It asks you for the confirmation.
7. Click YES to Uninstall the Silverlight
You can see the Uninstalling silverlight in bellow image.

Monday, 24 December 2012

Social networking website


Basic Social Networking Web site using C# - ASP.NET

Here goes Opensource  social networking application  signup sign in feature.Application is developed in ASP.NET 3.0 framework along with Microsoft enterprise library for database connectivity.A good start for those who are planning to develop a social networking website like FACEBOOK.The application has examples of how to do session handling in ASP.NET,Database connectivity, Interaction of content page with the master page,Roles and Rights management.
Session handling example code
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if (Session["username"] == null)
        {
            Response.Redirect("login.aspx");
 
        }
 
        else
        {
            Label messageLabel2 = (Label)Master.FindControl("username");
 
            messageLabel2.Text = Session["username"].ToString();
 
            string username = Session["username"].ToString();
 
            BusinessLayerClass SecurityBO = new BusinessLayerClass();
 
            DataSet userrole = SecurityBO.GetUserRole(username);
 
            if (userrole.Tables[0].Rows.Count > 0)
            {
 
                if (userrole.Tables[0].Rows[0]["RoleName"].Equals("Administrator"))
                {
                    LabelAdmin.Visible = true;
                    LabelNormalUser.Visible = false;
                    adminpage.Visible = true;
 
                }
 
                else
                {
                    LabelAdmin.Visible = false;
                    LabelNormalUser.Visible = true;
                    adminpage.Visible = false;
 
                }
 
            }
Interaction of content page with master page
?
1
2
3
Label messageLabel2 = (Label)Master.FindControl("username");
 
 messageLabel2.Text = Session["username"].ToString();
Roles and Rights management code
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
BusinessLayerClass SecurityBO = new BusinessLayerClass();
 
           DataSet userrole = SecurityBO.GetUserRole(username);
 
           if (userrole.Tables[0].Rows.Count > 0)
           {
 
               if (userrole.Tables[0].Rows[0]["RoleName"].Equals("Administrator"))
               {
                   LabelAdmin.Visible = true;
                   LabelNormalUser.Visible = false;
                   adminpage.Visible = true;
 
               }
 
               else
               {
                   LabelAdmin.Visible = false;
                   LabelNormalUser.Visible = true;
                   adminpage.Visible = false;
 
               }
 
           }
Database connectivity example
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
public class DAOBase
   {
       private string _CurrentConnectionString = "connection";
       internal Database Database;
 
       public DAOBase()
       {
 
           Database = DatabaseFactory.CreateDatabase(this.CurrentConnectionString);
 
       }
 
       public string CurrentConnectionString
       {
           get
           {
               return this._CurrentConnectionString;
           }
       }
 
       public DbTransaction BeginTransaction()
       {
           DbTransaction transaction;
 
           IDbConnection connection = Database.CreateConnection();
 
           connection.Open();
 
           transaction = (DbTransaction) connection.BeginTransaction();
 
           return transaction;
       }
 
       public bool EndTransaction(DbTransaction transaction)
       {
           if (transaction != null)
           {
               DbConnection connection = transaction.Connection;
 
               if (connection != null)
               {
                   transaction.Dispose();
                   connection.Close();
 
                   return true;
               }
           }
 
           return false;
       }
   }
Source Code  includes  (Project solution in visual studio 2o10. Database script file for Microsoft SQL Server 2005/2008
Click here to download the complete project source code