VB.NET - currency manager position

R

Ramesh

Hi,
Pls. answer to this question? Does the position change of
the currency manager affect the Dataset. Since I wanted to
use the HasChanges method of the dataset to check whether
is there any changes made in the dataset or not? But even
though i dint do any changes in the Dataset, but the
currency mgr. position changes the state of the Dataset as
Modified. Is this behaviour is correct? or what is the
solution for that?

DonRamesh
 
C

Cor Ligthert

Hi Ramesh,

In my opinion it should be something else, changing the currency position
does as far as I know nothing to the rowstate of a datatable in a dataset.

Show some code if you want some help (not a whole program please and first
pasted in a notebook to get not 3 rows on 1 page in my OE)?

Cor
 
R

Ramesh Muthukrishnan

Hi Cor Ligthert,
Here is my code

Private Sub BindData(Optional ByVal Pos As Integer = 0)
If bolCurMgr = False Then
Call ClearBinding()
txtType.DataBindings.Add(New Binding("Text", _dtAmenity,
"AMT_TYPE"))
If strFrmState <> "A" Then
txtType.DataBindings.Add(New Binding("Tag", _dtAmenity,
"ROWID"))
End If
txtDesc.DataBindings.Add(New Binding("Text", _dtAmenity,
"AMT_DESC"))
_curManager = CType(Me.BindingContext(_dtAmenity),
CurrencyManager)
_curManager.Position = Pos
End If
End Sub


I have debugged care fully and checked each and every line for the
rowstate behaviour, the state was unchanged till the line

_curManager = CType(Me.BindingContext(_dtAmenity), CurrencyManager)

but after executing the line
_curManager.Position = Pos

the has changes property of the dataset becomes modified

....
DonRamesh
 
R

Ramesh

Hi,
The code is

Private Sub BindData(Optional ByVal Pos As Integer = 0)
'Dim _dtTenantType As New DataTable
'_dtTenantType = _dsTenantType.Tables(0)
If bolCurMgr = False Then
Call ClearBinding()
txtType.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_TYPE"))
If strFrmState <> "A" Then
txtType.DataBindings.Add(New Binding
("Tag", _dtTenantType, "ROWID"))
End If
txtDesc.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_DESC"))
_curManager = CType(Me.BindingContext
(_dtTenantType), CurrencyManager)
_curManager.Position = Pos
'_dsTenantType.RejectChanges() '$$
End If
End Sub

I have debugged line by line, and checked the status of
the haschanges property of the Dataset, till that line
_curManager = CType(Me.BindingContext(_dtTenantType),
CurrencyManager), it showed unchanged,
but after executing the line
_curManager.Position = Pos
the haschanges property changes to Modified

DonRamesh
 
R

Ramesh

Hi,
The code is

Private Sub BindData(Optional ByVal Pos As Integer = 0)
'Dim _dtTenantType As New DataTable
'_dtTenantType = _dsTenantType.Tables(0)
If bolCurMgr = False Then
Call ClearBinding()
txtType.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_TYPE"))
If strFrmState <> "A" Then
txtType.DataBindings.Add(New Binding
("Tag", _dtTenantType, "ROWID"))
End If
txtDesc.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_DESC"))
_curManager = CType(Me.BindingContext
(_dtTenantType), CurrencyManager)
_curManager.Position = Pos
'_dsTenantType.RejectChanges() '$$
End If
End Sub

I have debugged line by line, and checked the status of
the haschanges property of the Dataset, till that line
_curManager = CType(Me.BindingContext(_dtTenantType),
CurrencyManager), it showed unchanged,
but after executing the line
_curManager.Position = Pos
the haschanges property changes to Modified

DonRamesh
 
G

Guest

Hi,
The code is

Private Sub BindData(Optional ByVal Pos As Integer = 0)
If bolCurMgr = False Then
Call ClearBinding()
txtType.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_TYPE"))
If strFrmState <> "A" Then
txtType.DataBindings.Add(New Binding
("Tag", _dtTenantType, "ROWID"))
End If
txtDesc.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_DESC"))
_curManager = CType(Me.BindingContext
(_dtTenantType), CurrencyManager)
_curManager.Position = Pos
End If
End Sub

I have debugged line by line, and checked the status of
the haschanges property of the Dataset, till that line
_curManager = CType(Me.BindingContext(_dtTenantType),
CurrencyManager), it showed unchanged,
but after executing the line
_curManager.Position = Pos
the haschanges property changes to Modified

DonRamesh
 
C

Cor Ligthert

Hi Ramesh,

There is a fact about it, it says something else, however the behaviour is
the same
http://support.microsoft.com/default.aspx?scid=kb;en-us;317254

I added the corrections in your program.

I hope this helps?

Cor

\\\
Private Sub BindData(Optional ByVal Pos As Integer = 0)
If bolCurMgr = False Then
Call ClearBinding()
txtType.DataBindings.Add(New Binding("Text",
_dtTenantType, "TEN_TYPE"))
If strFrmState <> "A" Then
txtType.DataBindings.Add(New Binding
("Tag", _dtTenantType, "ROWID"))

AddHandler txtType.DataBindings("Tag").Parse, AddressOf parseit
)
)
End If
End Sub
Sub parseit(ByVal o As Object, ByVal e As ConvertEventArgs)
Throw New Exception
End Sub
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top