"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Wednesday, August 17, 2011

Array in C# Part 2 [ Sort Reverse , IndexOf , LastIndexOf ]

Hi *.*,
Before reading this pls go through part 1(Last post).
 Array Reverse 
 

int[] intArray = new int[] { 4, 1, 3,3, -23,-23,6 };
Array.Reverse(intArray);
Output
Array IndexOf


int[] intArray = new int[] { 4, 1, 3,3, -23,-23,6 };
int idx = Array.IndexOf(intArray, -23);
 Output
 Array LastIndexOf

int[] intArray = new int[] { 4, 1, 3,3, -23,-23,6 };
int lstidx = Array.LastIndexOf(intArray, -23);
Output
 Difference b\w IndexOf and LastIndexOf
 
The method indexOf() returns the first occurrence (index) of a given character or a combination as parameter in a given string.
The method lastIndexOf() returns the last occurrence (last index) of a given character or combination in a given string.
For ur easy understanding i had given same value for both method.

Hope u got all
Take care
Have a nice day... 'N happy Coding :)

Tuesday, August 16, 2011

Array in C# [ Sorting Array ( Integer, Alphabet ), getting duplicate element from array]

Hi *.*,
C# arrays are zero indexed; that is, the array indexes start at zero. Arrays in C# work similarly to how arrays work in most other popular languages.Here i'm disgussing abt how to implement some function using array in c# and vb.
Array intialize
  • Sorting Array (Integer)
  • Sorting Array (Alphabet)
  • getting duplicate element from array
  Using c#
 
    public void aay()
    {
        int[] intArray = new int[] { 4, 1, 3,3, -23,-23 }; // Array intialize
         Array.Sort(intArray); // Sort Array
         string _duplicatelink = string.Empty;
         for (int i = 0; i <= intArray.Length; i++)  // Function getting duplicate element from array
        {
            if (intArray[i] == intArray[i + 1])
            {
                _duplicatelink = _duplicatelink + "," + intArray[i];
            }
        }
    }

    public void sortalpha() // Sorting Alphabet
    {
        String[] strArray = new String[] { "z", "a", "C" };
        Array.Sort(strArray);
    }

Using VB


    Public Sub aay()
        Dim intArray As Integer() = New Integer() {4, 1, 3, 3, -23, -23}
        ' Array intialize
        Array.Sort(intArray)
        ' Sort Array
        Dim _duplicatelink As String = String.Empty

        For i As Integer = 0 To intArray.Length
            ' Function getting duplicate element from array
            If intArray(i) = intArray(i + 1) Then
                _duplicatelink = _duplicatelink & "," & intArray(i)
            End If
        Next

    End Sub

    Public Sub sortalpha()
        ' Sorting Alphabet
        Dim strArray As [String]() = New [String]() {"z", "a", "C"}
        Array.Sort(strArray)
    End Sub


 Hope u got all...
Stay Tune...

 Have a nice day... 'N happy Coding :)

Wednesday, August 10, 2011

ASP Web Server Controls

 Hi *.*,
For a begineer in asp.net their is a chance for them to get confused of which control and whats its use 'n this post for them.

The syntax for creating a Web server control is:
<asp:control_name id="some_id" runat="server" />

AdRotator :    Displays a sequence of images
Button             Displays a push button
Calendar     Displays a calendar
CalendarDay     A day in a calendar control
CheckBox     Displays a check box
CheckBoxList     Creates a multi-selection check box group
DataGrid     Displays fields of a data source in a grid
DataList     Displays items from a data source by using templates
DropDownList     Creates a drop-down list
HyperLink     Creates a hyperlink
Image             Displays an image
ImageButton     Displays a clickable image
Label             Displays static content which is programmable (lets you apply styles to its content)
LinkButton     Creates a hyperlink button
ListBox     Creates a single- or multi-selection drop-down list
ListItem     Creates an item in a list
Literal     Displays static content which is programmable(does not let you apply styles to its content)
Panel             Provides a container for other controls
PlaceHolder     Reserves space for controls added by code
RadioButton     Creates a radio button
RadioButtonList Creates a group of radio buttons
BulletedList     Creates a list in bullet format
Repeater     Displays a repeated list of items bound to the control
Style             Sets the style of controls
Table             Creates a table
TableCell     Creates a table cell
TableRow     Creates a table row
TextBox     Creates a text box
Xml             Displays an XML file or the results of an XSL transform
CompareValidator         Compares the value of one input control to the value of another input control or to a fixed value
CustomValidator         Allows you to write a method to handle the validation of the value entered
RangeValidator                 Checks that the user enters a value that falls between two values
RegularExpressionValidator     Ensures that the value of an input control matches a specified pattern
RequiredFieldValidator         Makes an input control a required field
ValidationSummary         Displays a report of all validation errors occurred in a Web page

Stay tune...
Have a nice day... 'N happy Coding :)

Tuesday, August 9, 2011

Sample Lavalamp menu

Hi *.*,
A Lavalamp effect is simply made by an empty element with a declared background color that follows the mouse position when you move it through the items of a menu. In other words, it consists of a simple cursor that changes its left offset when you change your mouse position moving from an item to another.

DEMO


Saturday, August 6, 2011

Uses of Magic table in SQL SERVER

Uses of Magic table in SQL SERVER

1) Magic tables are nothing but inserted and deleted which are temporary object created by server internally to hold the recently inserted values in the case of insert and to hold recently deleted values in the case of delete, to hold before updating values or after updating values in the case of update.

Friday, August 5, 2011

Create Shortkeys in Windows Application

Hi *.*,
I had done only 2 projects(Minor) in windows application (Desktop). I'm planning to improve my knowledge over their too...Starts from here... :)

Create a new form named form1.And add a menu-strip on design space now moving towards code side over their u can find a method InitializeComponent(); right click and Go To Definition over their u can find initializing menu-strip just down different events are initializing on the menu-strip. Find which one you need to add short key and create an instance of that at their.

Example for short key ctrl+N

this.[controlname].ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));

Stay tune...

Have a nice day... 'N happy Coding :)

Show Date in webpage using javascript

Hi *.*,
This is my third post regarding show date on webpage. Fortunately all are unique :).



Zoom Effect on Grid Using Jquery and Css in asp.net

Hi *.*,
Recently i visited http://www.sohtanaka.com. I found this zoom effect. I get all the details from their and integrate in asp.net

Thursday, August 4, 2011

Overlapping one image over another on mouse-over

Hi *.*,
Last day i c this advt. I feel its nice, so i planned and done.'n Here its go.
Css

<style type="text/css">
.boxgrid {
    float: left;
    height: 126px !important;
    overflow: hidden;
    position: relative;
}
.cover {
    position: absolute;
    top: 128px;
}
</style>
Jquery
<script type="text/javascript">
$(document).ready(function(){
//Vertical Sliding
$('.boxgrid').hover(function(){
$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
}, function() {$(".cover", this).stop().animate({top:'128px'},
{queue:false,duration:300});});});
</script>


Html

<table>
<tr>
<td align="left" valign="top" id="mnphome">
<ul>
  <li class="boxgrid">
    <img width="136" height="125" src="largest_netword_1.jpg">
      <h3 class="cover" style="top: 128px;">
        <img width="136" height="125" src="desc_1.gif">
      </h3>
  </li>
</ul>
</td>
</tr>
</table>
Don't forgot to add js file :)


'n u can download a sample from here


Stay Tune...


Have a nice day... 'N happy Coding :)