D
Dana L. Stille
I have incorporated a search function into my .NET application. I use the Find method in the DataView, and return the index of the associated record. I use this integer to set the Position property of my BindingManager on my form. Refer to the code snippet below. When I use the search function on my development machine it works great, but when I install my application on another machine and use the search function the BindingManager is set to the same position but the controls on the form do not show the correct data. It is as if the dataset is index differently. I am setting the ApplyDefaultSort property to True, and from what I can gather this will align the DataView with the sort order of the dataset table I am using.
_________________________________________________________________________________________
' If Find routine is being used set the current SCR integer so that the
' binding manager can be position to the correct record in the dataset
If strGoToSCR <> "" Then
intCurrentSCR = dvSCRData.Find(strGoToSCR)
strGoToSCR = ""
End If
'If Current SCR Number is available search for it, and if its in the dataset move to it
If intCurrentSCR > 0 Then
SCRBindingManager.Position = intCurrentSCR
intCurrentSCR = 0
Else
SCRBindingManager.Position = SCRDataSet.scrdata.Rows.Count - 1
End If
_____________________________________________________________________________________
I would appreciate any suggestions on how to better position my data to the record I am searching. Thanks, and God Bless!
_________________________________________________________________________________________
' If Find routine is being used set the current SCR integer so that the
' binding manager can be position to the correct record in the dataset
If strGoToSCR <> "" Then
intCurrentSCR = dvSCRData.Find(strGoToSCR)
strGoToSCR = ""
End If
'If Current SCR Number is available search for it, and if its in the dataset move to it
If intCurrentSCR > 0 Then
SCRBindingManager.Position = intCurrentSCR
intCurrentSCR = 0
Else
SCRBindingManager.Position = SCRDataSet.scrdata.Rows.Count - 1
End If
_____________________________________________________________________________________
I would appreciate any suggestions on how to better position my data to the record I am searching. Thanks, and God Bless!