Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2006, 04:11 AM
Registered User
 
Join Date: May 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default newbie...database queries..

Hi all
I am a newbie.. so please be patient with me
i have been using vb6 all along
very recenty i am working myself on Visual Studio 2005

once i establised the conection to my MSAccess database (Trial.mdb) and refrence to the table (birthday_table)..uing a binding source
i am able to conect my textboxes to thetable and retrive recods in the table.
I ma using bindingnavigatpr to move throght the records and the text boxes are getting refreshed accordngly

[u]I want to retrive the value of <name> field each time the recordsource is refreshed </u>

in VB6 i will be using msgbox(adodc1.recordset.feilds("name")
in VB2005 i understand taht i have to use
....myDataTable.Rows(rowIndex)("Name")
here again...i am struck as to how will i be retiving the current-row index..aT runtimei might be missing something really silly here... so please be patinet with me

 
Old June 15th, 2006, 05:03 PM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here is how i grabbed fields from a currently selected record


Dim field1 As String
Dim dr As DataRowView = Sheet1BindingSource.Current
field1 = CStr(dr.Item("Description"))
messagebox.show(field1)


this code went in my binding navigator private sub and passed the currently selected row's "Description" column of my dataset to the string field1

hope that helps !!!

squeak squeak
 
Old June 16th, 2006, 12:41 AM
Registered User
 
Join Date: May 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by squeakstar
 here is how i grabbed fields from a currently selected record


Dim field1 As String
Dim dr As DataRowView = Sheet1BindingSource.Current
field1 = CStr(dr.Item("Description"))
messagebox.show(field1)


this code went in my binding navigator private sub and passed the currently selected row's "Description" column of my dataset to the string field1

hope that helps !!!

squeak squeak
thnks squeak i shall let u know as soon as i try this






Similar Threads
Thread Thread Starter Forum Replies Last Post
Database diagrams (aka Queries) Steve1977 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 September 14th, 2008 07:06 AM
using @cursor in Perl database queries crmpicco Perl 0 March 2nd, 2007 08:33 AM
Database Queries frosty ASP.NET 2.0 Basics 3 May 13th, 2006 06:20 PM
Queries on Back End database? gazolba Access 3 May 1st, 2004 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.