6

Create Horizontal Menu Bar using HTML and CSS


Following is a simple demonstration of how to get a horizontal menu bar using HTML (using <ul> / <li>) and CSS.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>Sample by Yasser.</title>
  <style type="text/css">
.hovermenu ul{
font: bold 18px calibri;
height: 25px;
}

.hovermenu ul li{
list-style: none;
display: inline;
}

.hovermenu ul li a{
padding: 10px 25px 10px 25px;
text-decoration: none;
float: left;
color: white;
background-color: rgb(15,41,77);
border: 1px solid rgb(15,41,77);
}

.hovermenu ul li a:hover{
background-color: #e5e5e5;
color:rgb(15,41,77);
}
</style>
 </head>

 <body>

<div class="hovermenu">
<ul>
<li><a href="">Menu1</a></li>
<li><a href="">Menu2</a></li>
<li><a href="">Menu3</a></li>
<li><a href="">Menu4</a></li>
<li><a href="">Menu5</a></li>
</ul>
</div>

</body>
</html>

Expected Output:

 Cheers!
0

How to do SELECT TOP @Param in a Stored Procedure?

 How to do SELECT TOP @Param in a Stored Procedure? 

Here I have created an integer param which is used later in the SELECT statement.

CREATE PROCEDURE [dbo].[SP_get]
@my_param int   
AS
BEGIN
      SET NOCOUNT ON;

SELECT TOP (@top_param) col1, col2, col3
      FROM TableName 
0

An unsecured or incorrectly secured fault was received from the other party


An unsecured or incorrectly secured fault was received from the other party

This error normally occurs when the Time Zone of the server and the client are different.
The remote server and the client's system time must be within 10 minutes of each other.
Solution 1:
So One Temporary solution was to change the TimeZone as well as the Time to the time currently on the server.
Solution 2:
Was to include the following security node under the binding of custom binding element.
<security authenticationMode="Kerberos">
   <localClientSettings maxClockSkew="00:07:00" />
   <localServiceSettings maxClockSkew="00:07:00" />
   <secureConversationBootstrap>
      <localClientSettings maxClockSkew="00:30:00" />
      <localServiceSettings maxClockSkew="00:30:00" />
   </secureConversationBootstrap>
</security>
0

Read specific nodes from an XML File

The following article discusses how to read an XML file. 
The sample XML file that i have used is also attached below.
I have used XmlTextReader for reading. 
The   while (reader.Read()) return true until all the nodes of the document are read. 
reader.ReadToFollowing("repeat_element");
is used to jump to the specified node, incase you are not interested in any other node and want to read only that node or its child nodes. 
reader.Name returns the name of the element and reader.ReadString() will return its value/innerText.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;

namespace sample
{
    class Xml_Reader
    {
        FileStream fileStream;
        string fileName = string.Empty;
        static int count = 0;
        
        public void Read()
        {
            fileName = @"D:\Yasser Files\sample.xml";
            fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);

            string temp_variable = "";

            using (XmlTextReader reader = new XmlTextReader(fileStream))
            {
                // To jump to the node where we want to begin our search from.
                reader.ReadToFollowing("repeat_element");

                while (reader.Read())
                {
                    if(reader.NodeType == XmlNodeType.Element)
                    {
                        switch (reader.Name)
                        {
                            case "interested_element1":
                                {
                                    temp_variable += "--"+ reader.ReadString();
                                    break;
                                }
                            case "interested_element2":
                                {
                                    temp_variable += "--" + reader.ReadString();
                                    break;
                                }
                            case "interested_element3":
                                {
                                    temp_variable += "--" + reader.ReadString();
                                    break;
                                }
                            case "interested_element4":
                                {
                                    temp_variable += "--" + reader.ReadString();
                                    break;
                                }
                            case "interested_element5":
                                {
                                    temp_variable += "--" + reader.ReadString();
                                    break;
                                }
                        }//end of switch
                    }//end of if loop.
                }//end of reader.
            }
        }
    }
}

<?xml version="1.0" encoding="utf-8" ?>
<myroot>
  <repeat_element>
    <nt_interested_element1>aa</nt_interested_element1>
    <interested_element1>yasser</interested_element1>
    <nt_interested_element2>cc</nt_interested_element2>
    <interested_element2>sachin</interested_element2>
    <nt_interested_element3>eee</nt_interested_element3>
    <interested_element3>sehwag</interested_element3>
    <somelevel>
      <somelevelDown>
        <deep>
          <interested_element4>dhoni</interested_element4>
          <interested_element5>raina</interested_element5>
        </deep>
      </somelevelDown>
    </somelevel>
  </repeat_element>
  <repeat_element>
    <nt_interested_element1>11</nt_interested_element1>
    <interested_element1>ramesh</interested_element1>
    <nt_interested_element2>33</nt_interested_element2>
    <interested_element2>suresh</interested_element2>
    <nt_interested_element3>55</nt_interested_element3>
    <interested_element3>sonu</interested_element3>
    <somelevel>
      <somelevelDown>
        <deep>
          <interested_element4>monu</interested_element4>
            <interested_element5>ronu</interested_element5>
        </deep>
      </somelevelDown>
    </somelevel>
  </repeat_element>
</myroot>

0

What is CLR (Common Language Runtime) in the .NET framework



  • The Common Language Runtime is responsible for executing your application code.
  • In .NET, source code is never compiled directly into the machine code. Instead the compiler converts the code into an intermediate language called MSIL(Microsoft Intermediate Language).
  • MSIL is a low-level, platform independent language.
  • Whenever your application executes, the MSIL code is "just-in-time" compiled into machine code by JIT compiler. 
  • JIT compiler is responsible for converting your MSIL code into machine level language for its execution.
  • So, in reality the .NET framework understands only one langauge and that is MSIL.
  • However you can write applications using different languages such as VB, C#, J# etc.


1

Skype has stopped working error in Windows 7

"I recently had this same problem, where my SKYPE would quit after every 5 seconds with a message that said "Skype has stopped working.Windows will now close the program". 
Here is what I did for it to work again. This worked for me, lets hope it works for you too.

1. Firstly you will need to close your skype. Be sure that it is closed by checking the system tray. If skype's icon is still there, right click it and select quit.
2. Next you will need to select show Hidden files from your folder view option.
3. Once that is done press WindowsKey + R: to start the Run Utility
4. Type %appdata%\Skype in it and press enter
5. Delete the shared.xml file.
6. Restart Skype and its done! 
7. A new shared.xml file will be created. And Skype should start working again.
0

Introduction to MVC Architecture

MVC requires .NET framework 3.5 or above. The following describes the architecture of MVC:
MVC stands fro MODEL - VIEW - CONTROLLER.

Controller:
Controller is responsible for recieving request from the web server and identifies the action requirement . Depending on the requirement the controller contacts the corresponding MODEL. The Model will supply the required data, will which be rendered to User Interface using a VIEW.
Controller is responsible for handling request and responding to it.
Inside the controller class several action methods can be implemented.

Model:
Model are responsible for implementing any bussiness logic.
Models are  components responsible for maintaing states. Often this state is maintained in the database.

View:
It is a component responsible for displaying the application's UI.
View can be of any language such as C#, Razor, PHP, JSP etc.
 

2011 ·Code-Studio by yrus.