Design VB.Net to display the employee details in grid view as well as in textboxes after clicking next and previous command button.(use database)
Public Class Form1 Dim r, i As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'EmpDataSet.em' table. You can move, or remove it, as needed. Me.EmTableAdapter.Fill(Me.EmpDataSet.em) r = 1 i = 0 End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If EmpDataSet.Tables(0).Rows.Count > r Then TextBox1.Text = EmpDataSet.Tables(0).Rows(r)(i) TextBox2.Text = EmpDataSet.Tables(0).Rows(r)(i + 1) TextBox3.Text = EmpDataSet.Tables(0).Rows(r)(i + 2) TextBox4.Text = EmpDataSet.Tables(0).Rows(r)(i + 2) TextBox5.Text = EmpDataSet.Tables(0).Rows(r)(i + 2)) i = 0 r = r + 1 Else MsgBox("No More Records") r = EmpDataSet.Tables(0).Rows.Count - 1 End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If r >= 0 Then TextBox1.Text = EmpDataSet.Tables(0).Rows(r)(i) TextBox2.Text = EmpDataSet.Tables(0).Rows(r)(i + 1) TextBox3.Text = EmpDataSet.Tables(0).Rows(r)(i + 2) TextBox4.Text = EmpDataSet.Tables(0).Rows(r)(i + 2) i = 0 r = r - 1 Else MsgBox("No More Records") r = 0 End If End Sub Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click End Sub End Class
Design VB.Net to display the employee details in grid view as well as in textboxes after clicking next and previous command button.(use database)
Reviewed by
on
April 27, 2015
Rating: