.OnlineGuruji: VB.Net

.OnlineGuruji

Provides E-Notes,Video Tutorials And Download Links For Students In hindi

*********************************************************

*********************************************************
********************************************************************************

Breaking

Ramchandicollege Saraipali

Technology Jobs

OnlineGuru Blog मे आपका स्वागत है ब्लॉग से संबन्धित जानकारी के लिए संपर्क करें मो ॰ नम ।-9826026747(सपन कुमार दास) अपने विषय से संबन्धित अपडेट प्राप्त करने के लिए ब्लॉग पे दिये गए Bell Icon को press करें कम्प्युटर,Science,English Grammer से संबन्धित विषय की अधिक जानकारी के लिए हमारे ब्लॉग अथवा यू ट्यूब चैनल को सब्क्राइब करे ..
Showing posts with label VB.Net. Show all posts
Showing posts with label VB.Net. Show all posts

Saturday, April 20, 2024

April 20, 2024

VB.net Practical String Related

 

 





Public Class Form6

 

    'Two String Compare

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim str1 As String

        Dim str2 As String

 

 

        str1 = InputBox("Enter string1: ")

 

 

        str2 = InputBox("Enter string2: ")

 

 

        If str1 = str2 Then

            MsgBox("Strings are equal")

        Else

            MsgBox("Strings are not equal")

        End If

    End Sub

 

    'String Join using string.Join

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim str() As String = {"Hello", "how", "are", "you"}

        Dim result As String

 

        result = String.Join("_", str)

        MsgBox(result)

    End Sub

 

    'String Compare using string.Compare

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Dim str1 As String = "Hello"

        Dim str2 As String = "hello"

        Dim str3 As String = "Hello"

 

        Dim ret As Integer = 0

 

        'ret = String.Compare(str1, str2)

        'If ret = 0 Then

        '    MsgBox("Strings matched")

        'Else

        '    MsgBox("Strings are different")

        'End If

 

        ret = String.Compare(str1, str3)

        If ret = 0 Then

            MsgBox("Strings matched")

        Else

            MsgBox("Strings are different")

        End If

 

    End Sub

 

    'String Concat using string.Concat

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        Dim str1 As String = "Seema "

        Dim str2 As String = "Pati "

        Dim str3 As String

 

        str3 = String.Concat(str1, str2)

 

        MsgBox(str1)

        MsgBox(str2)

        MsgBox(str3)

 

    End Sub

    'String Copy using string.copy

 

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Dim str1 As String = "Hello World"

        Dim str2 As String

 

        str2 = String.Copy(str1)

 

        MsgBox(str1)

        MsgBox(str2)

    End Sub

 

    'Check number in string

 

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

        Dim num As String

        num = InputBox("Enter Any String")

        Dim ret As Boolean

 

        ret = IsNumeric(num)

 

        If (ret = True) Then

            MsgBox("Specified string contains a number")

        Else

            MsgBox("Specified string does not contain a number")

        End If

    End Sub

 

    'check enter value is pelindrome or not

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

        Dim r, s As String

        s = InputBox("Enter Any String")

        r = StrReverse(s)

        If s = r Then

            MsgBox("String Is Pelindrom")

        Else

            MsgBox("String Is Not Pelindrom")

        End If

    End Sub   

  

'Check Vowel or consonent using select case

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click

        Dim ch As Char

        ch = InputBox("Enter Any Character")

        Select Case ch

            Case "a", "i", "u", "o", "e"

                MessageBox.Show("Small " + ch + " Is Vowel")

 

            Case "A", "E", "I", "O", "E"

                MessageBox.Show("Capital  " + ch + " Is Vowel")

            Case Else

                MessageBox.Show(ch + " Is Consonent")

        End Select

 

 

    End Sub

 

    'Display Date And Time From DTPICKER In Textbox

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

        Dim d As Date

        d = DateTimePicker1.Value

        TextBox1.Text = d.Day

        TextBox2.Text = d.Month

        TextBox3.Text = d.Year

 

    End Sub

 

    'Change Upper Case

 

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

        Dim st As String

        st = TextBox4.Text

        Dim st1 As String

        st1 = st.ToUpper

        MessageBox.Show("String  " + st + "  IS In Upper Case   " + st1)

 

    End Sub

    'Change Lower Case

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click

        Dim st As String

        st = TextBox4.Text

        Dim st1 As String

        st1 = st.ToLower

        MessageBox.Show("String  " + st + "  IS In Upper Case   " + st1)

 

    End Sub

End Class

 

Thursday, March 28, 2024

March 28, 2024

What is Data Type in VB.NET in Hindi ----Sapan Das

  

 


What is Data Type in VB.NET in Hindi

किसी भी Programming में Data Types महत्वपूर्ण भूमिका निभाता है क्योंकि ये संग्रहित होने वाले Data के प्रकार को और Operations को जिसे Perform किया जाना है परिभाषित करता है

जब किसी Variable को Declare को किया जाता है तो हमे उसके डाटा Type को भी लिखना होता है क्योंकि किसी Variable में किस प्रकार कि Value Store होगी यह Data Type पर ही निर्भर करती है, Variable का Data Type जिस प्रकार का होगा उसमें उसी प्रकार कि Value Store होगी

 Programming मे data types Data का type define करते हैं। Data types store होने वाले data के type के साथ ही उसकी data storage length भी बताते है। Visual Basic मे variables को निम्नलिखित पाँच categories मे बांटा गया है।

 

 

All Data Types in VB.NET in Hindi - VB.NET के सभी Data Types

VB.NET में विभिन्न प्रकार के Data को Store करने के लिए कई प्रकार के Data Types उपलब्ध है जिसमे कुछ Fundamentals Data Types निम्न है

1) Integer Types:

a) Integer:

-2,147,483,648 से 2,147,483,647 तक इसका प्रयोग whole numbers को Store करने के लिए होता है यह Memory में 4 Byte स्थान लेता है

b) Long:

-9,223,372,036,854,775,808 से 9,223,372,036,854,775,807 तक यह Integer से ज्यादा बड़े Whole number को Store करता है तथा Memory में 8 Byte स्थान लेता है

c) Short:

यह Integer से छोटे Whole number -32,768 से 32,767 तक Store करता है और Memory में 2 Byte स्थान लेता है

2) Floating-Point Types:

a) Single:

यह Single-precision floating point numbers -3.402823E+38 से 1.401298E-45(Negative numbers) तथा 1.401298E-45 से 3.402823E+38 (Positive numbers) को Store करता है और Memory में 4 Byte लेता है

b) Double:

यह Double-precision floating-point numbers 1.79769313486231 E + से-4.94065645841247E-324 (Negative values) और 4.94065645841247-324 से 1.79769313486232E308(Positive Values) Store करता है यह Memory में 8 Byte लेता है जो Single Precision से बड़ी Values Store करता है

3) Decimal Type:

a) Decimal':

इसके high Precision के कारण यह financial calculations के लिए अच्छा है इसमे Decimal Point के बाद Right Side 28 स्थान हो सकते है इसका प्रयोग बहुत बड़े Floating Point Values को Store करने के लिए करते है यह Memory में 16 Byte स्थान लेते हैं

4) Boolean Type:

a) Boolean:

इसमें true (1) या false (0) Values Store करने में किए जाते है

5) Character Types:

a) Char:

0 से 65535 तक Number Store कर सकते हैं और इसका उपयोग हम Character को Store करने में कर सकते हैं यह Memory में 2 Byte स्थान लेता है

6) String Type:

a) String:

इस Data Type मे किसी Characters या Text को एक क्रम से Store कर सकते है

7) Date and Time Types:

a) Date:

इसमें Date values को Store करते है जो Memory में 8 Byte लेता है Date का Range 0:00:0(midnight) January 1, 0001 से December 31,9999 के 11:59:59 PM तक

b) DateTime:

इसमें Date और Time दोनो Values एक साथ Store कर सकते हैं

c) TimeSpan:

इसमें Time के Interval को प्रदर्शित करने के लिए इस Data Type का Use करते है

8) Other Types:

a) Object:

इस Data Type का प्रयोग किसी भी प्रकार के Object को Store करने में होता है

b) Byte:

0 से 255 इसका उपयोग Binary Data को Store करने में होता है यह इसके Character मानो को Numeric Format में भी Store कर सकते हैं

c) SByte:

यह-128 से लेकर 127 तक Signed Integer या Whole Number वाले Data को Store करने में होता है यह Memory में 1 Byte लेता है

d) UInteger:

यह 0 से 4,294,967,295 तक unsigned whole numbers को Store करने में प्रयुक्त होता है Memory में 4 Byte लेता है

e) ULong:

यह 0 से 18,446,744,073,709,551,615 unsigned whole numbers को Store करता है यह Memory में 8 Byte लेता है

f) UShort:

यह 0 से 65,535 तक छोटी unsigned whole numbers को Store करता है यह Memory मे 2 Byte लेता है

What is Data Type in VB.NET in Hindi

किसी भी Programming में Data Types महत्वपूर्ण भूमिका निभाता है क्योंकि ये संग्रहित होने वाले Data के प्रकार को और Operations को जिसे Perform किया जाना है परिभाषित करता है

जब किसी Variable को Declare को किया जाता है तो हमे उसके डाटा Type को भी लिखना होता है क्योंकि किसी Variable में किस प्रकार कि Value Store होगी यह Data Type पर ही निर्भर करती है, Variable का Data Type जिस प्रकार का होगा उसमें उसी प्रकार कि Value Store होगी

 Programming मे data types Data का type define करते हैं। Data types store होने वाले data के type के साथ ही उसकी data storage length भी बताते है। Visual Basic मे variables को निम्नलिखित पाँच categories मे बांटा गया है।

 

 

• Numeric

• String

• Boolean

• Date

• Object

1. Numeric Variables: ऐसे नंबर्स जिनमे डेसीमल पॉइंट का उपयोग नही किया जाता है, Integer numbers कहलाते है | इसमे numbers store करने वाले data type आते हैं। इनका प्रयोग mathematical operations perform करने के लिए किया जाता है। इसमे निम्न data type's आते हैं-

• Short (Int16): यह integer value को स्टोर करने लिए use होता है। इसमे 32768 से 32767 तक value store की जा सकती है और यह memory मे 2 bytes लेती है।

Dim a As Short

a = 10000

• Integer (Int32): यह integer value को स्टोर करने लिए use होता है। इसमे 2147483648 से 2147483647 तक value store की जा सकती है और यह memory मे 4 bytes लेती है। Dim a As Integer

• Single: यह single precision floating no को स्टोर करता है। इसमे -3.402823E38 से 1.401298E-45 और 1.401298E-45 से 3.402823E38 तक value store कर सकता है। यह 4 byte memory लेता है।

• Double: यह double precision floating no को स्टोर करता है। इसमे -1.797693134486232E308से

-4.94065645841247E-324 और 4.94065645841247E-324 से 1.797693134486232E308 तकvalue store

कर सकता है। यह 8 byte memory लेता है।

• Decimal: इसमे 0 से

7.9228162514264337593543950335 positive और negative value storeकर सकते हैं। यह memory मे 16 Byte लेता है।

• Byte: यह भी एक numeric data type है जो की 0 से 255 तक की value store की जाती है। यहmemory मे 2 byte लेता है।

3. String:Characters के समूह को स्ट्रिंग कहते है यह characters को store करने के लिए प्रयोग होता है। इसमे निम्न 2 type होते हैं।

• String: यह केवल text को store करने के लिए use किया जाता है। यह set of characters को स्टोर करता है। इसमे 2 GB तक text store कर सकते है।

• Char : यह single character को store करने के लिए use होता है। और memory मे 2 byte space लेता है।

4. Boolean: इस data type का प्रयोग True या false value store करने के लिए किया जाता है। अधिकतर इसका प्रयोग conditions check करने में होता है।

5. Date: यह data type date और time store करने के लिए प्रयोग किया जाता है। इसमे date या time कोstore करने के लिए # कैरक्टर का प्रयोग करते है।

Dim a As Date

a = #1/4/2005#

6. Object: यह एक common data type है जो की सभी data types के common features के साथ सभी प्रकार की value store करने के लिए use किया जाता है।

Dim a As Short a = 10000

• Integer (Int32): यह integer value को स्टोर करने लिए use होता है। इसमे -2147483648 से 2147483647 तक value store की जा सकती है और यह memory में 4 bytes लेती है। Dim a As Integer a = 1000000

• Long (Int64): यह integer value को स्टोर करने लिए use होता है। इसमे integer से अधिकvalue store की जा सकती है और यह memory मे 8 bytes लेता है।

2.Floating point Numbers: ऐसे नंबर्स जिनमे डेसीमल पॉइंट का उपयोग किया जाता है, Floating point Numbers कहलाते

• Single: यह single precision floating no को स्टोर करता है। इसमे -3.402823E38 से 1.401298E-45 और

 

Type

Storage Allocation

Value Range

Boolean

Depends on implementing platform

True or False

Byte

1 byte

0 through 255 (unsigned)

Char

2 bytes

0 through 65535 (unsigned)

Date

8 bytes

0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999

Decimal

16 bytes

0 through +/-79,228,162,514,264,337,593,543,950,335 (+/-7.9...E+28) with no decimal point; 0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal

Double

8 bytes

-1.79769313486231570E+308 through -4.94065645841246544E-324, for negative values

4.94065645841246544E-324 through 1.79769313486231570E+308, for positive values

Integer

4 bytes

-2,147,483,648 through 2,147,483,647 (signed)

Long

8 bytes

-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807(signed)

Object

4 bytes on 32-bit platform

8 bytes on 64-bit platform

Variable of type ‘object’ can be used to store any type.

SByte

1 byte

-128 through 127 (signed)

Short

2 bytes

-32,768 through 32,767 (signed)

Single

4 bytes

-3.4028235E+38 through -1.401298E-45 for negative values;

1.401298E-45 through 3.4028235E+38 for positive values

String

Depends on implementing platform

0 to approximately 2 billion Unicode characters

UInteger

4 bytes

0 through 4,294,967,295 (unsigned)

ULong

8 bytes

0 through 18,446,744,073,709,551,615 (unsigned)

User-Defined

Depends on implementing platform

Each structure component has a range determined by its data type and is independent of the ranges of the other members.

UShort

2 bytes

0 through 65,535 (unsigned)