0

Clear an Array in c#

string[] arr = new string[4];arr[0] = "000";arr[1] = "111";arr[2] = "222";arr[3] = "333"; Array.Clear(arr, 0, arr.Length...
0

How to use Stopwatch in C#

Create an object of Stopwatch class and start it, then execute the method, logic whose execution time is to be calculated. Next stop the watch shown below. Stopwatch watch = new Stopwatch();watch.Start();            for (int i = 0; i < 100000; i++){ ...
0

How to limit decimal places in double

Here I am limiting the decimal places to 3 in a double.  double old_value = 3.142356; double new_value = Math.Round(old_value, 3);...
0

How to block a website

1.       Open Run, and type in ‘C:\Windows\System32\drivers\etc’, press enter. A folder should open up with the following contents. 2.       From the above files, open the “hosts” file using a notepad. The following is how the contents of...
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...
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    ASBEGIN      SET NOCOUNT ON; SELECT TOP (@top_param) col1, col2,...
0

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

An unsecured or incorrectly secured fault was received from the other partyThis 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...
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...
 

2011 ·Code-Studio by yrus.