VB.NET Help ???

kpg

Well-known member
  • Jun 3, 2008
    3,445
    1,805
    113
    In My Home
    01) * How create own classes using VB.Net


    * How Would You set Property and method on your own class


    * Crate a class called student following properties
    Name
    Reg-Number
    Address


    *What is mean by shared property



    Menna Me Tikata ANSWER Danna KEnek Hoyala DennakoOooooooooo
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    Create a Class =

    Class <Class Name>
    ........}
    ........} - Body
    ........}
    End Class

    or

    Right Click on Project in Solution Explorer
    Click Add -> then Click on New Item
    Then Select VB Class then change the name and Click Add
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    Mcn you cant set property or method in a class class is only a structure please i think the question is not correct please check it and tell me bro

    Shared Property Means that you can share it with other methods or classes it can be a global variable

    Ex:

    Public number As Integer
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    Mcn For your Second question i think u mean that how to define properties and methods in a class ne

    So following is da examples

    Properties are variables which u use to store data

    To create a property

    <Scope> <Variable Name> As <Data Type>

    Example :

    Dim Number As Integer
    Private Name As String
    Public Status As Boolean


    Method is a piece of code which you define to do a specific task in VB.NET it has 2 types of methods
    1 - With a return type - Where the method return a value
    2 - With no return type - No value is returned


    but in other languages there is only one type of method for both of this


    1 method with return type are called functions

    <Scope> Function <Function Name>()
    .......
    .........
    ......
    Return value
    End Function

    Example

    Private Function CalculateTotal()
    Dim num As Interger
    num = 1 + 1
    return num
    End Function


    2 - method with no return are called subs or simply methods

    <Scope> Sub <Method Name>
    ............
    ........
    ......
    End Sub

    Example

    Private Sub Display()
    me.txtName.Text = "Hello";
    End Sub
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    Sample Class

    Class Student

    Private Name As String
    Private Reg-Number As Integer
    Private Address As String

    End Class
     
    Last edited:

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    Also Mcn there is a separate variables called property variables if you want to know about them just let me know they ar a bit advanced concept merging with object properties
     

    kpg

    Well-known member
  • Jun 3, 2008
    3,445
    1,805
    113
    In My Home
    02}
    1 Difference between JVM & MSIL(Microsoft Intermediate Language )
    2 Explain following .Net Frame work
    I. Class Library
    II. Common language Run time
    3 language support .Net Frame work




    Menna Next Question eka...................
     

    kpg

    Well-known member
  • Jun 3, 2008
    3,445
    1,805
    113
    In My Home
    03)
    ü Describe 3 tier architecture use in application development
    ü Explain following .Net Frame work
    * Solution explore
    * server explore
    ü Code in following Out Put

    WELCOME TO VB.NET
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    1. Difference between JVM & MSIL(Microsoft Intermediate Language ) itz a huge topic bt 4 da absolute basic following are the thingz

    JVM - Converts the Code to Java Byte Code and then execute the byte code as the program. the code is not readable by humans itz sole intention is to be executed by the machine dose both compilation and interpretation and it supports only Java

    MSIL - Converts Code to (.NET bytecode) Execution to CLI which is more human readable. MSIL was developed explicitly for JIT compilation. It supports several languages (VB.NET, C#.NET, C++) and has more explicit delineation between value and reference types

    2. Explain

    Class Library
    Collection of Predefined Classes which are used to create applications by programmers.
    The class library consist of Microsoft Classes and if needed user can add some also(advanced).

    Common Language Runtime

    [FONT=Verdana, Arial, Helvetica, sans-serif]The Common Language Runtime (CLR), is the runtime environment of the .NET framework, which manages the execution of code and provides services.
    It gets the compiled code from the MSIL and interprets into machine readable language It has five components namely:[/FONT]



    • [*][FONT=Verdana, Arial, Helvetica, sans-serif]CTS - Common Type System [/FONT]
      [*][FONT=Verdana, Arial, Helvetica, sans-serif]CLS - Common Language Specification [/FONT]
      [*][FONT=Verdana, Arial, Helvetica, sans-serif]CIL - Common Intermediate Language [/FONT]
      [*][FONT=Verdana, Arial, Helvetica, sans-serif]JIT - Just in Time Compiler [/FONT]
      [*][FONT=Verdana, Arial, Helvetica, sans-serif]VES - Virtual Execution System[/FONT]
    3 Language support .NET

    VB.NET (Visual Basic.NET)
    C#.NET
    C++
    F#.NET (in Visual Studio 2005 and 2010 only)


    mcn what is this course?
     

    DragonFox

    Junior member
  • Oct 16, 2009
    369
    9
    18
    Colombo
    1 .3tire Architecture

    View (Model) - This is the user interfaces of the application all the coding of data inputs and output are situated here

    Business Layer - This contains all the logic of the program conditions loops etc...

    Data Layer - All the data access is done here (INSERT,UPDATE,DELETE,SELECT) all the sql statements are executed in this layer

    The architecture means developing the code in the above way by passing all the values through layers and executing the application logic this improves program readability, extendability and maintainability


    2. Explain

    Solution Explorer - Contains all the files and other projects regarding the current application

    Server Explorer - this is used to manage connections to other servers like SQL Server, Windows Exchange etc...

    Both is used to manage the client and server side of an application


    3 Code (In Console View) - Coded in Visual Studio 2010

    Module Module1

    Sub Main()
    Console.WriteLine("WELCOME TO VB.NET")
    End Sub

    End Module