Queryng Acees Database

L

Luis

Hello,

In VB6.0 if I have a recorset and I want to move to a
specific location on it (let´s say a Field wich is the
primary key and is autoincrement) I woul type .Findfirst
where IDPAC = 5.
With the tecnology in VB.NET How can I do the same, ou
similar?

What I wont to do is to move to a specific record in a
table or recordset where my primary as a determined value.

Thanks in advance
 
W

William Ryan

Totally depends on what objects you are using? For instance, in a keyed
DataTable, you could use the .Select method. In a DataView, you could set
the .RowFilter. You can move around a BindingContext as well.

In a DataReader, you only now about one row at a time, so you'd need to walk
it until you found the value you are looking for (DataReaders are great
objects, but not well suited to what it appears you are looking for).
Hello,

In VB6.0 if I have a recorset and I want to move to a
specific location on it (let´s say a Field wich is the
primary key and is autoincrement) I woul type .Findfirst
where IDPAC = 5.
With the tecnology in VB.NET How can I do the same, ou
similar?

What I wont to do is to move to a specific record in a
table or recordset where my primary as a determined value.

Thanks in advance
 
C

Cor

Hi Luis,

Using a dataset you do more than with a recordset.
Some here typed examples (so there can be little errors)

To get in the 3th row the Item "Luis" in the first table of ds,
(ds=dataset)
ds.tables(0).rows(2)("luis") or if you want
ds.tables(0).rows(2).item("luis")

to find the first row in a table where the key is "luis"
dim dr as new datarow
'"luis" is the key colomn
dr = ds.tables(0).rows.find("luis")

to select a couple of rows
dim drselect() as datarow
drselect = ds.tables(0).select("myselectstatement")

And there are thousands more possiblities

What is confusing is that all documentation is in:
datasets
datatables
datarows
datarowscollections

But look at the introduction to datasets

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbcondatasets.asp

I hope this helps?

Cor













"Luis" <[email protected]> schreef in bericht
Hello,

In VB6.0 if I have a recorset and I want to move to a
specific location on it (let´s say a Field wich is the
primary key and is autoincrement) I woul type .Findfirst
where IDPAC = 5.
With the tecnology in VB.NET How can I do the same, ou
similar?

What I wont to do is to move to a specific record in a
table or recordset where my primary as a determined value.

Thanks in advance
 

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