Thank you.
The sample you gave is not going to work for me by the following reason:
If let's say I create a datatable with JobIDs and the second table should
contain all related records. It's going to be a huge amount of data.
With my current approach the first datatable is used only as a set of
JobIDs where I can go to the next, previous etc record.
I'm looking for the way to set a pointer in a first datatable (JobIDs) to
the particular JobID, not to the 20th or 1235th record in the datatable.
For instance I have the following JobIDs (presented as datarows in a
datatable):
7, 26, 5, 10, 135, 1354, 18, 35, 35655, 123, 345, 12323 etc. (they are
sorted by some criteria in SP)
If I use databindings I can go from the JobID = 7 to JobID = 26 by using
Position +=1
After I came to the second position I can retrieve JobID which is equal to
26 in this particular case. Then using it as a parameter I can retrieve all
data for this particular Job by using another SP. It will give me a second
datatable with a single datarow. The minimal amount of data is passing from
DB. I don't need any datarelation here.
My question again:
For instance I'm doing a search. I need to find a Job with the name "Testing
Job". I'm retrieving a JobID for the Jobs having "Testing Job" in their
names.
I'm getting for instance 5 JobIDs (10, 18, 123)
My pointer in the first datatable is on Position 0, let's say now. How do I
set it to Position 3 which has JobID = 10?
If I was able to do that then I could go from position 3 to position 4 or
position 2 when I use Position +=1. For now I do not know how to do that.
I also could go to the Position 1 in search datatable by using Position +=1,
retrieve JobID, which is 18, set the pointer to the Position 6 in a first
datatable, having the ability to go to Position 7 or 5.
So it's the same if I work with ADO by using Recordset.MoveNex,
Recordset.MovePrevious, Recordset.Find.
I have this code in VB6:
rsAllIDs.MoveFirst
rsAllIDs.Find "JobID = " & lngJobID 'This value vas taken in some
other procedure, like search for instance
GetCurrentRecord lngJobID' This procedure will populate all controls
on the form with data belonging to the JobID sitting in lngJobID variable.
The pointer in rsAllIDs is on the record found by Find method of the
recordset.
How to translate this small block of code to ADO.NET?
Thank you