Newbie - Help Please!

D

Del

Hi,

I apologise in advance if this is not the correct place to be asking this
question, but here goes:

I am a complete novice; I need to be able to query a table in an access
database and populate a textbox on a form with the returned result(s). Could
someone please point me in the right direction as to where I may learn how to
do this.

I am trying to do this through a form designed in Visual Basic.NET Standard and
the database which resides on my machine is Access XP.

Thanks in advance.
 
C

Cowboy \(Gregory A. Beamer\)

A couple of methods:
1. Set up OLEDB connection (System.Data.OleDb.OleDbConnection)
2. Set up OLEDB command object (with your query)
3. Set up OLEDB DataAdapter and attach command
4. Fill DataSet with Fill() method of DataAdapter
5. Bind DataTable in DataSet to your textbox

or
1. Set up OLEDB connection (System.Data.OleDb.OleDbConnection)
2. Set up OLEDB command object (with your query)
3. Use command object to fill a OleDbDataReader
4. Bind DataReader to textbox

Make sure the data you are returning returns a single value, as a textbox
takes a single field. This is the basics. THe help file and the quickstarts
both contain examples of this type of binding.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
 

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