Form1.vb

 'Imports System.Drawing.Brush
Imports System.Data.OleDb
Imports System.Object

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer. 
    'Do not modify it using the code editor.
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents Button6 As System.Windows.Forms.Button
    Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
    Friend WithEvents Button7 As System.Windows.Forms.Button
    Friend WithEvents Button8 As System.Windows.Forms.Button
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents TextBox7 As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Button3 = New System.Windows.Forms.Button()
        Me.TextBox5 = New System.Windows.Forms.TextBox()
        Me.TextBox4 = New System.Windows.Forms.TextBox()
        Me.TextBox3 = New System.Windows.Forms.TextBox()
        Me.TextBox2 = New System.Windows.Forms.TextBox()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.Button5 = New System.Windows.Forms.Button()
        Me.Button6 = New System.Windows.Forms.Button()
        Me.TextBox6 = New System.Windows.Forms.TextBox()
        Me.Button7 = New System.Windows.Forms.Button()
        Me.Button8 = New System.Windows.Forms.Button()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.PictureBox1 = New System.Windows.Forms.PictureBox()
        Me.TextBox7 = New System.Windows.Forms.TextBox()
        Me.SuspendLayout()
        '
        'Button3
        '
        Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button3.Location = New System.Drawing.Point(152, 256)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(32, 24)
        Me.Button3.TabIndex = 26
        Me.Button3.Text = "|<"
        '
        'TextBox5
        '
        Me.TextBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox5.Location = New System.Drawing.Point(296, 168)
        Me.TextBox5.Name = "TextBox5"
        Me.TextBox5.Size = New System.Drawing.Size(168, 23)
        Me.TextBox5.TabIndex = 22
        Me.TextBox5.Text = ""
        '
        'TextBox4
        '
        Me.TextBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox4.Location = New System.Drawing.Point(296, 136)
        Me.TextBox4.Name = "TextBox4"
        Me.TextBox4.Size = New System.Drawing.Size(168, 23)
        Me.TextBox4.TabIndex = 20
        Me.TextBox4.Text = ""
        '
        'TextBox3
        '
        Me.TextBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox3.Location = New System.Drawing.Point(296, 104)
        Me.TextBox3.Name = "TextBox3"
        Me.TextBox3.Size = New System.Drawing.Size(168, 23)
        Me.TextBox3.TabIndex = 19
        Me.TextBox3.Text = ""
        '
        'TextBox2
        '
        Me.TextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox2.Location = New System.Drawing.Point(296, 72)
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.Size = New System.Drawing.Size(168, 23)
        Me.TextBox2.TabIndex = 18
        Me.TextBox2.Text = ""
        '
        'TextBox1
        '
        Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox1.Location = New System.Drawing.Point(296, 40)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(168, 23)
        Me.TextBox1.TabIndex = 17
        Me.TextBox1.Text = ""
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label5.Location = New System.Drawing.Point(184, 168)
        Me.Label5.Name = "Label5"
        Me.Label5.TabIndex = 16
        Me.Label5.Text = "Class"
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label4.Location = New System.Drawing.Point(184, 136)
        Me.Label4.Name = "Label4"
        Me.Label4.TabIndex = 15
        Me.Label4.Text = "Roll No"
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label3.Location = New System.Drawing.Point(184, 104)
        Me.Label3.Name = "Label3"
        Me.Label3.TabIndex = 14
        Me.Label3.Text = "Father Name"
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label2.Location = New System.Drawing.Point(184, 72)
        Me.Label2.Name = "Label2"
        Me.Label2.TabIndex = 13
        Me.Label2.Text = "Student Name"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label1.Location = New System.Drawing.Point(184, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.TabIndex = 11
        Me.Label1.Text = "Student ID"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(255, Byte))
        Me.Label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label6.Location = New System.Drawing.Point(184, 8)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(144, 23)
        Me.Label6.TabIndex = 12
        Me.Label6.Text = "Student Records"
        '
        'Button4
        '
        Me.Button4.Location = New System.Drawing.Point(184, 256)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(32, 24)
        Me.Button4.TabIndex = 27
        Me.Button4.Text = "<"
        '
        'Button5
        '
        Me.Button5.Location = New System.Drawing.Point(320, 256)
        Me.Button5.Name = "Button5"
        Me.Button5.Size = New System.Drawing.Size(32, 24)
        Me.Button5.TabIndex = 28
        Me.Button5.Text = ">"
        '
        'Button6
        '
        Me.Button6.Location = New System.Drawing.Point(352, 256)
        Me.Button6.Name = "Button6"
        Me.Button6.Size = New System.Drawing.Size(32, 24)
        Me.Button6.TabIndex = 25
        Me.Button6.Text = ">|"
        '
        'TextBox6
        '
        Me.TextBox6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox6.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox6.Location = New System.Drawing.Point(216, 256)
        Me.TextBox6.Name = "TextBox6"
        Me.TextBox6.Size = New System.Drawing.Size(104, 23)
        Me.TextBox6.TabIndex = 21
        Me.TextBox6.Text = "TextBox5"
        '
        'Button7
        '
        Me.Button7.Location = New System.Drawing.Point(224, 216)
        Me.Button7.Name = "Button7"
        Me.Button7.Size = New System.Drawing.Size(80, 24)
        Me.Button7.TabIndex = 23
        Me.Button7.Text = "Add/New"
        '
        'Button8
        '
        Me.Button8.Location = New System.Drawing.Point(312, 216)
        Me.Button8.Name = "Button8"
        Me.Button8.Size = New System.Drawing.Size(80, 24)
        Me.Button8.TabIndex = 24
        Me.Button8.Text = "Save"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(400, 216)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(80, 24)
        Me.Button1.TabIndex = 24
        Me.Button1.Text = "Delete"
        '
        'PictureBox1
        '
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Bitmap)
        Me.PictureBox1.Location = New System.Drawing.Point(16, 32)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(88, 248)
        Me.PictureBox1.TabIndex = 29
        Me.PictureBox1.TabStop = False
        '
        'TextBox7
        '
        Me.TextBox7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TextBox7.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TextBox7.Location = New System.Drawing.Point(8, 288)
        Me.TextBox7.Name = "TextBox7"
        Me.TextBox7.Size = New System.Drawing.Size(504, 23)
        Me.TextBox7.TabIndex = 22
        Me.TextBox7.Text = "Email : imrantareen@hotmail.com    Website :   http://www.indusdera.tk "
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.AliceBlue
        Me.ClientSize = New System.Drawing.Size(520, 310)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.PictureBox1, Me.Button3, Me.TextBox5, Me.TextBox4, Me.TextBox3, Me.TextBox2, Me.TextBox1, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1, Me.Label6, Me.Button4, Me.Button5, Me.Button6, Me.TextBox6, Me.Button7, Me.Button8, Me.Button1, Me.TextBox7})
        Me.Name = "Form1"
        Me.Text = "ListBox Application"
        Me.ResumeLayout(False)

    End Sub

#End Region
    Dim cn As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Application.StartupPath & "\namu.mdb")
    Dim cm1 As New OleDbCommand("Select * from stutbl", cn)

    Dim da1 As New OleDbDataAdapter(cm1)
    Dim ds1 As New DataSet()
    Dim d, k

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button8.Enabled = False
        cn.Open()
        da1.Fill(ds1, "stutbl")

        TextBox1.Text = ds1.Tables("stutbl").Rows(0).Item(0)
        TextBox2.Text = ds1.Tables("stutbl").Rows(0).Item(1)
        TextBox3.Text = ds1.Tables("stutbl").Rows(0).Item(2)
        TextBox4.Text = ds1.Tables("stutbl").Rows(0).Item(3)
        TextBox5.Text = ds1.Tables("stutbl").Rows(0).Item(4)
    End Sub


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

        k = ds1.Tables("stutbl").Rows.Count
        If d + 1 < k Then
            d = d + 1
            TextBox1.Text = ds1.Tables("stutbl").Rows(d).Item(0)
            TextBox2.Text = ds1.Tables("stutbl").Rows(d).Item(1)
            TextBox3.Text = ds1.Tables("stutbl").Rows(d).Item(2)
            TextBox4.Text = ds1.Tables("stutbl").Rows(d).Item(3)
            TextBox5.Text = ds1.Tables("stutbl").Rows(d).Item(4)
        Else
            'MsgBox("Last Record")
            d = 0
            TextBox1.Text = ds1.Tables("stutbl").Rows(d).Item(0)
            TextBox2.Text = ds1.Tables("stutbl").Rows(d).Item(1)
            TextBox3.Text = ds1.Tables("stutbl").Rows(d).Item(2)
            TextBox4.Text = ds1.Tables("stutbl").Rows(d).Item(3)
            TextBox5.Text = ds1.Tables("stutbl").Rows(d).Item(4)
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        k = ds1.Tables("stutbl").Rows.Count
        If d + 1 < k Then
            d = d + 1
            TextBox1.Text = ds1.Tables("stutbl").Rows(d).Item(0)
            TextBox2.Text = ds1.Tables("stutbl").Rows(d).Item(1)
            TextBox3.Text = ds1.Tables("stutbl").Rows(d).Item(2)
            TextBox4.Text = ds1.Tables("stutbl").Rows(d).Item(3)
            TextBox5.Text = ds1.Tables("stutbl").Rows(d).Item(4)
        Else
            MsgBox("Last Record")
            d = 0
            TextBox1.Text = ds1.Tables("stutbl").Rows(d).Item(0)
            TextBox2.Text = ds1.Tables("stutbl").Rows(d).Item(1)
            TextBox3.Text = ds1.Tables("stutbl").Rows(d).Item(2)
            TextBox4.Text = ds1.Tables("stutbl").Rows(d).Item(3)
            TextBox5.Text = ds1.Tables("stutbl").Rows(d).Item(4)
        End If
    End Sub

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

        d = 0
        TextBox1.Text = ds1.Tables("stutbl").Rows(d).Item(0)
        TextBox2.Text = ds1.Tables("stutbl").Rows(d).Item(1)
        TextBox3.Text = ds1.Tables("stutbl").Rows(d).Item(2)
        TextBox4.Text = ds1.Tables("stutbl").Rows(d).Item(3)
        TextBox5.Text = ds1.Tables("stutbl").Rows(d).Item(4)
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        k = ds1.Tables("stutbl").Rows.Count
        TextBox1.Text = ds1.Tables("stutbl").Rows(k - 1).Item(0)
        TextBox2.Text = ds1.Tables("stutbl").Rows(k - 1).Item(1)
        TextBox3.Text = ds1.Tables("stutbl").Rows(k - 1).Item(2)
        TextBox4.Text = ds1.Tables("stutbl").Rows(k - 1).Item(3)
        TextBox5.Text = ds1.Tables("stutbl").Rows(k - 1).Item(4)
    End Sub

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

        Dim cm1 As New OleDbCommand("Select StudentID from stutbl", cn)
        Dim da1 As New OleDbDataAdapter(cm1)
        Dim ds1 As New DataSet("stutbl")
        Try
            da1.Fill(ds1, "stutbl")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        TextBox1.Text = Val(ds1.Tables("stutbl").Rows.Count + 1)
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        Button8.Enabled = True
        Button7.Enabled = False
        Button1.Enabled = False
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim cm As New OleDbCommand("insert into stutbl values(" & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')", cn)
        Dim da1 As New OleDbDataAdapter(cm)
        Dim ds1 As New DataSet("stutbl")

        Try
            da1.Fill(ds1, "stutbl")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        MsgBox("Record id Inserted")
        TextBox1.Focus()
        Button7.Enabled = True
        Button8.Enabled = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cm As New OleDbCommand("Delete From stutbl Where StudentID=" & TextBox1.Text, cn)
        Dim da1 As New OleDbDataAdapter(cm)
        Dim ds1 As New DataSet("stutbl")

        Try
            da1.Fill(ds1, "stutbl")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
        MsgBox("Record is Deleted")
        TextBox1.Focus()
        Button7.Enabled = True
        Button8.Enabled = False
    End Sub
End Class

Project Homepage: