retrieve item dataset/dataview

G

Guest

Hello,

I simpy want to place a record ID into a session variable.
I know how to create session variables, I'm just can't figure out the syntax
for the record item when I'm working with a dataset. I'm using vb.

session(sessionName) = recordID 'from dataset or dataview

Thanks,
Enrique

Any help appreciated, Thanks
 
E

EMW

I would use something like:

session(SessionName) =
dataset.tables("tablename").rows(number)("columnname")

Is this what you meant?
Otherwise could you be more specific?

rg,
Eric
 
G

Guest

Thank you for the reply, Eric

Ok, this is what I want to do,
grab the "ID" of a record from a dataset that is filtered with a dataview.

-------------------------------------
DataAdapter.Fill(DataSetX)
DataView.RowFilter = "recordXID = 150" 'this returns one record/row
session("SessionName") = recordYID 'an item from the DataView
-------------------------------------

What you gave me seems close to what I need.
Your example retrieves the row specified ie. row(0) returns the first row.
I need to dynamically retrieve the row from the filtered dataview.
I have half a brain, right now, so hopefully I'm making sense.

Regards,
enrique
 
G

Guest

Thank you for the reply, Eric

Ok, this is what I want to do,
grab the "ID" of a record from a dataset that is filtered with a dataview.

-------------------------------------
DataAdapter.Fill(DataSetX)
DataView.RowFilter = "recordXID = 150" 'this returns one record/row
session("SessionName") = recordYID 'an item from the DataView
-------------------------------------

What you gave me seems close to what I need.
Your example retrieves the row specified ie. row(0) returns the first row.
I need to dynamically retrieve the row from the filtered dataview.
I have half a brain, right now, so hopefully I'm making sense.

Regards,
enrique
 
E

EMW

Just this week I found out that if you use DataViewRow you can read the row
in the order of the filtered and sorted dataview.

dim dvr as dataviewrow

dvr = dataview(recordnumber)

then

dvr(column1) = something
dvr(column2) = something
etc..

Hope this helps...

rg,
Eric
 
G

Guest

It helped greatly!

Although it worked as DataRowView as opposed to "dataviewrow" :)

my working code:
----------------------------
Dim xID As Int32
Dim yID As Int32
Dim dvr As DataRowView

'//// Filter DataRow
dvr = dvwShows(0)
xID = dvr(0)
yID = dvr(1)
----------------------------

You're a good man, Thanks!

-Enrique
 
E

EMW

I wrote the example out of my head and since my brain is aways busy working
out coding problems and developing new ideas even before one line of code is
written, you can imagin why I got it wrong.. ;-)

rg,
Eric
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top