Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retreving values from a row in the dataset

Status
Not open for further replies.

jennyek2000

Programmer
Sep 2, 2003
43
GB
I want to retreive the value of the primary key of the last row in a dataset. I have used the following code so far,

Dim mydataset As New DataSet()

myDataAdapter = New OleDbDataAdapter("SELECT * FROM transmittals", myConnection)
myDataAdapter.Fill(mydataset, "transmittals")

Dim bmtransmittals As BindingManagerBase
bmtransmittals = Me.BindingContext(mydataset, "Transmittals")
bmtransmittals.Position = bmtransmittals.Count - 1

Hopefully this code has got me to the last row in the dataset? But now how do I retreive the value of the primary
key (transNo) so that I can display it in a text box?

Thanks,
Jenny
 
Hello,

Bind the text box that you want to show the data to the primary key of your data. I tried this on my form and it worked.

Hope this helps

Brian

BTW : Thanks for your help earlier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top