+ Reply to Thread
Results 1 to 10 of 10

Thread: cegonsoft profile | Learn for each loop in C# .net

  1. #1

    Default cegonsoft profile | Learn for each loop in C# .net

    C# also provides a foreach loop that allows you to loop through the items in a set of data. With a foreach loop, you don’t need to create an explicit counter variable. Instead, you create a variable that represents the type of data for which you’re looking. Your code will then loop until you’ve had a chance to process each piece of data in the set.

    The foreach loop is particularly useful for traversing the data in collections and arrays.

    Example:

    string[] stringArray = {"one", "two", "three"};
    foreach (string element in stringArray)
    {
    // This code loops three times, with the element variable set to
    // "one", then "two", and then "three".
    Console.Write(element + " ");
    }

    In this case, the foreach loop examines each item in the array and tries to convert it to a string. Thus, the foreach loop defines a string variable named element. If you used a different data type, you’d receive an error.

    The foreach loop has one key limitation: it’s read-only. For example, if you wanted to loop through an array and change the values in that array at the same time, foreach code wouldn’t work.

    Here’s an example:

    int[] intArray = {1,2,3};
    foreach (int num in intArray)
    {
    num += 1;
    }

    In this case, you would need to fall back on a basic for loop with a counter.

    Visit: Cegonsoft

  2. #2

    Default

    Microsoft .Net Framework is the most important and totally different factor which categorizes VB.Net into new group of programming language. CLR (Common Language Runtime) is the heart of .Net Framework and manages almost every part of .Net compliant languages. Garbage Collection is a vital concept of CLR which plays an important role in disposal and freeing up unused and hanging memory object. CLR plays an important part in memory management through Garbage Collection. Along with these features, VB.Net is extremely type safe and has error handling flexibility in more structured manner. CLS (Common Language Specification) and CTS (Common Type System) in .Net Framework introduce new data type changes and constraints which help to make VB.Net language independent. GAC (Global Assembly Cache) and Strong Name concept in VB.Net resolve the issue of naming and registration of same DLL having multiple version.
    cegonsoft basics beginners training.

  3. #3

    Default

    Static/Shared classes are used when a class provides functionality which is not specific to
    any instance. In short if you want an object to be shared between multiple instances you
    will use a static/Shared class.

    Following are features of Static/Shared classes:-

    1. They cannot be instantiated. By default an object is created on the first method
    call to that object.
    2. Static/Shared classes cannot be inherited.
    3. Static/Shared classes can have only static members.
    4. Static/Shared classes can have only static constructor.


    Public Class ClsShared
    Shared intCount As Integer
    Public Function AddCount() As Integer
    intCount = intCount + 1
    Return intCount
    End Function
    End Class

    Public Class FrmSharedClasses Inherits System.Windows.Forms.Form
    Private Sub CmdInstance1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdInstance1.Click
    Dim pobjClsShared As New ClsShared()
    MessageBox.Show(“The count at this moment is” & pobjClsShared.AddCount.ToString())
    End Sub

    Private Sub CmdInstance2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdInstance2.Click
    Dim pobjClsShared As New ClsShared()
    MessageBox.Show(“The count at this moment is” & pobjClsShared.AddCount.ToString())
    End Sub
    End Class

    Cegonsoft

  4. #4

    Default

    For each loop: ARRAYS

    <%@ Page Language="VB" %>
    <script runat="server">
    Dim ColorList(6) as String

    Sub Page_Load
    ColorList(0) = "Red"
    ColorList(1) = "Orange"
    ColorList(2) = "Yellow"
    ColorList(3) = "Green"
    ColorList(4) = "Blue"
    ColorList(5) = "Indigo"
    ColorList(6) = "Violet"
    Array.Sort(ColorList)

    If Not Page.IsPostback
    Dim ColorName as String

    For Each ColorName in ColorList
    ddlColorList.Items.Add(ColorName)
    Next
    End If
    End Sub

    Sub btnSelectColor_Click(sender As Object, e As EventArgs)
    lblOutputMessage.Text = "You selected " & ddlColorList.SelectedItem.Value
    lblOutputMessage.ForeColor = _
    System.Drawing.Color.FromName(ddlColorList.Selecte dItem.Text)
    End Sub

    </script>
    <html>
    <head>
    </head>
    <body>
    <form runat="server">
    <p>
    Select a color from the list:<aspropDownList id="ddlColorList" runat="server"></aspropDownList>
    <asp:Button id="btnSelectColor" onclick="btnSelectColor_Click" runat="server" Text="Click here!"></asp:Button>
    </p>
    <p>
    <asp:Label id="lblOutputMessage" runat="server"></asp:Label>
    </p>
    </form>
    </body>
    </html>

    cegonsoft

  5. #5

    Default

    Cegonsoft provides the very good training in the technology wise.They provide the technology training on the basis of the industry standard.So that the cegonsoft trained peoples get the good placement and also they get the the good knowledge in their desired field.
    In cegonsoft they provide the soft skill training.In this training the HR mold the students based on the industry standard.
    They provide the good placement opportunity also so that the students in the cegonsoft get the opportunity to attend the many companies..
    Cegonsoft

  6. #6

    Default

    Hi,
    While having nice reviews, Cegonsoft is the best IT training centre who makes freshers to learn and understand various technologies quickly and easily and also place them in various multinational companies .They have Experienced and Intelligent Tech Consultants who puts a lot of effort and hard work to make all these possible. The HR team has also doing very nice work to provide Soft Skills and guide students according to the Corporate Standard requirements and as a result most of the students are getting placement right after training.

    Cegonsoft

  7. #7

    Default

    It's a useful looping program
    Cegonsoft

  8. #8

    Default

    The foreach statement repeats a group of statements for each element in a table or a collection of objects. The foreach statement is used to iterate through the collection to obtain the desired information, but should not be used to modify the contents of the collection to avoid unpredictable side effects.

    // cs_foreach.cs
    class ForEachTest
    {
    static void Main(string[] args)
    {
    int[] fibarray = new int[] { 0, 1, 2, 3, 5, 8, 13 };
    foreach (int i in fibarray)
    {
    System.Console.WriteLine(i);
    }
    }
    }


    cegonsoft

  9. #9
    Emerald Star member madhusundar is on a distinguished road
    Join Date
    Sep 2011
    Posts
    104

    Default .NET frameworks and Training in CEGONOSOFT

    C# is Microsoft's new programming language for the .NET platform.
    It combines some of the best features of modern programming languages such as Java, C++ or Visual Basic.
    C# is an object-oriented language with single inheritance but multiple interfaces per class.
    It supports component-based programming by properties (smart fields), events and delegates (enhanced function pointers).

    The .NET framework created by Microsoft is a software development platform that focuses on rapid application development, platform independence and network transparency.

    .NET is Microsoft's strategic initiative for server and desktop development for the next decade.
    According to Microsoft, .NET includes many technologies that are designed to facilitate rapid development
    of Internet and Intranet applications. .NET-connected solutions aim to enable businesses integrate their systems
    more rapidly and in a more agile manner and help them realize the promise of information anytime, anywhere, on any device.


    Training in CEGONSOFT:

    Cegonsoft is an IT Training center with an exclusive expertise in the area of HR consultancy.
    Cegonsoft provides Job oriented IT Training in Python with Placement assistance.
    Cegonsoft provides :

    Expertise Technical Consultant
    Development oriented syllabus
    Exclusive placement cell to assist in placement.
    Special soft skill class.
    Free brush up after course for interviews
    Free project for all course

    CEGONSOFT

  10. #10

    Default Re: cegonsoft profile | Learn for each loop in C# .net

    Microsoft C # is a new programming language designed to create a wide range of business applications that run on the .NET Framework.
    C# .NET is mainly a high level Object Oriented Programming Language.
    C# .NET is mainly derived from C language.
    C# .NET is used to develop following types of applications.
    (1) Console Applications.
    (2) Windows Applications.
    (3) Web Applications.
    (4) Class Library Applications.
    (5) Windows Control Library Applications.
    (6) Web Control Library Applications.
    (7) Web Service Applications.

    Cegonsoft offers .NET training as industry standards and cover all the advanced concepts as well. The quality of the curriculum is such that most students were placed right after the completion of course.
    They also provide comprehensive material for students and exposure to live projects that help students to find the right job.


    Cegonsoft

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts