Hi Bryan,
Thanks for replying.
I am using the same code as written in book . also i have downloaded the bindingexample code from site . I am sorry to say may be i miss some thing. but its also not working. Null exception error comes at "Cm.Position +=1".
I am strucked from 3 weeks on same page of the book

. Plz guide.
Here is my code.
'import Data and Sql client namespaces
Imports System.Data
Imports System.Data.SqlClient
Public Class Form1
'Global Declarations
Dim con As New SqlConnection("Data Source=KRISHNA-PC;Initial Catalog=Demo Database NAV (6-0);Integrated Security = True")
Dim da As New SqlDataAdapter("Select * from [CRONUS India Ltd_$Vendor]", con)
Dim ds As DataSet
Dim dv As DataView
Dim cm As CurrencyManager
Private Sub FillDataSetAndView()
'Initialize a new instance of dataset
ds = New DataSet()
'Fill dataset with data
da.Fill(ds, "[CRONUS India Ltd_$Vendor]")
'Set Dataview
'dv = New DataView(ds.Tables(0))
dv = New DataView(ds.Tables(0))
'Set cureency manager
'cm = CType(Me.BindingContext(dv), CurrencyManager)
cm = CType(Me.BindingContext(dv), CurrencyManager)
End Sub
Private Sub BindFields()
'clear any previous binding
txtAdd.DataBindings.Clear()
txtcity.DataBindings.Clear()
txtname.DataBindings.Clear()
txtNo.DataBindings.Clear()
'Add New Bindings
txtNo.DataBindings.Add("Text", ds, "[CRONUS India Ltd_$Vendor].No_")
txtname.DataBindings.Add("Text", ds, "[CRONUS India Ltd_$Vendor].Name")
txtAdd.DataBindings.Add("Text", ds, "[CRONUS India Ltd_$Vendor].Address")
txtcity.DataBindings.Add("Text", ds, "[CRONUS India Ltd_$Vendor].City")
'Display a ready status
ToolStripStatusLabel1.Text = "Ready"
End Sub
Private Sub ShowPosition()
'Display the current record and no of records
txtrecposition.Text = cm.Position + 1 & "of " & cm.Count
End Sub
Private Sub ToolTip1_Popup(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PopupEventArgs) Handles ToolTip1.Popup
End Sub
Private Sub StatusStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs ) Handles StatusStrip1.ItemClicked
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Add Item to combobox
cboField.Items.Add("No.")
cboField.Items.Add("Name")
cboField.Items.Add("Add")
cboField.Items.Add("City")
'Make the first item selected
cboField.SelectedIndex = 0
'Fill the dataset and bind the field
FillDataSetAndView()
BindFields()
'Show the current record position
ShowPosition()
End Sub
Private Sub cboField_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboField.SelectedIndexChanged
End Sub
Private Sub btnmovefirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmovefirst.Click
cm.Position = 0
Me.BindingContext(ds, "[CRONUS India Ltd_$Vendor]").Position = 0
ShowPosition()
End Sub
Private Sub btnmovepre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmovepre.Click
cm.Position -= 1
Me.BindingContext(ds, "[CRONUS India Ltd_$Vendor]").Position -= 1
ShowPosition()
End Sub
Private Sub btnmovenext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmovenext.Click
cm.Position += 1
'Me.BindingContext(ds, "[CRONUS India Ltd_$Vendor]").Position += 1
ShowPosition()
End Sub
Private Sub btnmovelast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmovelast.Click
cm.Position = cm.Count - 1
Me.BindingContext(ds, "[CRONUS India Ltd_$Vendor]").Position = Me.BindingContext(ds, "[CRONUS India Ltd_$Vendor]").Count - 1
ShowPosition()
End Sub
Private Sub btnSort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSort.Click
'Determine the appropriate selected item and sort property of dataview
Select Case cboField.SelectedIndex
Case 0 'No.
dv.Sort = "No_"
Case 1 'Name
dv.Sort = "Name"
Case 2 'Add
dv.Sort = "Add"
Case 3 'City
dv.Sort = "City"
End Select
'Call the click event for move first button
btnmovefirst_Click(Nothing, Nothing)
'Display a messate that record has been sorted
ToolStripStatusLabel1.Text = "Records has been Sorted"
End Sub
Private Sub btnnew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnew.Click
'txtNo.Text = " "
'txtname.Text = " "
'txtAdd.Text = " "
'txtcity.Text = " "
'declare local varibale
'Dim intposition As Integer, intmaxid As Integer
'Dim strid As String
'Dim objcommand As New SqlCommand
'save the current record position
'intposition = cm.Position
'createa new sqlcommand object
'Dim maxidcommand As SqlCommand = New SqlCommand ("Select MAX(No_) AS MAXID " &
End Sub
End Class
Regards
Kapil