This is my whole code to be precise:-->
Imports System.Data
Imports System.Data.OracleClient
______________________________________________________________________
Public Class Form1
Dim connString As New String("Data Source=Parv;Persist Security Info=True;User ID=pubs1;Password=pubs1;Unicode=True")
Dim conn As New OracleConnection(connString)
Dim cmd As OracleCommand = conn.CreateCommand()
Dim objDataAdapter As New OracleDataAdapter(cmd)
Dim objDataSet As pubs1DataSet
Dim objDataView As DataView
Dim objCurrencyManager As CurrencyManager
______________________________________________________________________
Private Sub FillDataSetandView()
objDataSet = New pubs1DataSet()
objDataAdapter.Fill(objDataSet, "authors_t")
objDataView = New DataView(objDataSet.Tables("authors"))
objCurrencyManager = CType(Me.BindingContext(objDataView), CurrencyManager)
End Sub
___________________________________________________________________________________
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmd.CommandText = "SELECT authors.au_id,authors.au_lname,authors.au_fname,titles.title,titles.price FROM authors,titles,titleauthor WHERE authors.au_id = titleauthor.au_id AND titles.title_id = titleauthor.title_id"
FillDataSetandView()
cboField.Items.Add("Last Name")
cboField.Items.Add("First Name")
cboField.Items.Add("Book Title")
cboField.Items.Add("Price")
cboField.SelectedIndex = 0
BindFields()
ShowPosition()
End Sub
___________________________________________________________________________________
Private Sub BindFields()
txtLastName.DataBindings.Clear()
txtFirstName.DataBindings.Clear()
txtBookTitle.DataBindings.Clear()
txtPrice.DataBindings.Clear()
Me.txtLastName.DataBindings.Add(New Windows.Forms.Binding("Text", Me.objDataSet, "authors.au_lname"))
Me.txtFirstName.DataBindings.Add(New Windows.Forms.Binding("Text", Me.objDataSet, "authors.au_fname"))
Me.txtBookTitle.DataBindings.Add(New Windows.Forms.Binding("Text", Me.objDataSet, "titles.title"))
Me.txtPrice.DataBindings.Add(New Windows.Forms.Binding("Text", Me.objDataSet, "titles.price"))
StatusStrip1.Text = "Ready"
End Sub
____________________________________________________________________________________
Private Sub ShowPosition()
txtRecordPosition.Text = objCurrencyManager.Position + 1 & " of " & objCurrencyManager.Count()
End Sub
Private Sub btnMoveFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMoveFirst.Click
objCurrencyManager.Position = 0
ShowPosition()
End Sub
___________________________________________________________________________________
Private Sub btnMovePrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMovePrevious.Click
objCurrencyManager.Position -= 1
ShowPosition()
End Sub
___________________________________________________________________________________
Private Sub txtMoveNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMoveNext.Click
objCurrencyManager.Position += 1
ShowPosition()
End Sub
___________________________________________________________________________________
Private Sub btnMoveLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMoveLast.Click
objCurrencyManager.Position = objCurrencyManager.Count - 1
ShowPosition()
End Sub
_____________________________________________________________________________________
Private Sub btnPerformSort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPerformSort.Click
Select Case cboField.SelectedIndex
Case 0 'Last Name
objDataView.Sort = "au_lname"
Case 1 'First Name
objDataView.Sort = "au_fname"
Case 2 'Book Title
objDataView.Sort = "title"
Case 3 'Price
objDataView.Sort = "price"
End Select
btnMoveFirst_Click(Nothing, Nothing)
StatusStrip1.Text = "Records Sorted"
End Sub
___________________________________________________________________________________
End Class
_____________________________________________________________________________________