OK here is some code we made up. We created a While loop to find the
recordnumber in the table. All this to set the pointer to the right
item. Not a very fast method when a table gets large as it will. The
current procedure needs to to scroll through every time we lookup a
number. So how can we do better. We understand it is best NOT to use
recordnumbers. So we gave every record a unique indexnumber and set
the key to that but somehow we cant set the pointer to that indexkey
in the table.
English is not our native language as is VB yet! Hope any of you can
help us.
Me.BindingContext(DsNewsTitle1, "IsDsNewsTitle").Position =
SearchNews(DsNewsRoomTemp1, DsNewsTitle1, "IsDsNewsRoom",
"IsDsNewsTitle", "ID_IsDsNewsTitle", "Subject", 5)
Function SearchNews(ByVal cDataSetRoot, ByVal cDataSetSearch, ByVal
cRootTable, ByVal cSearchTable, ByVal cSearchKey, ByVal cField, ByVal
nField)
Dim nEnd As Integer = Me.BindingContext(cDataSetSearch,
cSearchTable).Count
Dim cFound As String =
(cDataSetRoot.Tables(cRootTable).Rows(FormNews.nTa bleNewsRoom -
1)(cSearchKey)).ToString
Dim cFoundRow As DataRow =
cDataSetSearch.Tables(cSearchTable).Rows.Find(cFou nd)
Dim nRecord As Integer = 0
If Not (cFoundRow Is Nothing) Then
Do While nRecord < nEnd
If
cDataSetSearch.Tables(cSearchTable).Rows(nRecord)( cField) =
cFoundRow(nField) Then Exit Do
nRecord += 1
Loop
If nRecord = nEnd Then Return 0
Return nRecord
End If
End Function
On Tue, 7 Sep 2004 15:22:43 -0400, "Jeff Johnson [MVP: VB]"
<i.***@enough.spam> wrote:
"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:34********************************@4ax.com.. .
How can we set and read the pointer in a listbox or a combibox to the
found search. We use the datarow function with SQL2000 and VB.NET.
Hope anyone can help
Some folks may take a guess, but I recommend that you give a little more
detail. I for one don't really understand what you're trying to do. Some
sample code of what you've already tried would be helpful, too.