How do i retrieve the data in VB.NET using Microsoft access?

  • Thread starter Thread starter Hannie
  • Start date Start date
H

Hannie

I am currently doing my project using VB.NET
I have a database which contains all my data that the user key in.

The problem is, when i click the retrieve button on the form, the
details that the user keyed in cant be retrieve.

The connection is made, just that the data cant be retrive.
Hope someone can help mi... Thanks. its urgent... =]
 
Hannie,

You would have to tell something more, to get help.
By instance
Do you use a dataadapter
Does the user typein in a datagrid
What is the actions you do when the user has pushed in that button

After that maybe we can than help you.

Cor
 
Cor said:
Hannie,

You would have to tell something more, to get help.
By instance
Do you use a dataadapter
Does the user typein in a datagrid
What is the actions you do when the user has pushed in that button

After that maybe we can than help you.

Cor

Um, well i m using the OleDb connection codings to link to the
database.

My program works like this...

Form One: a pic of a hand with alot of buttons representing the
accupoints of our hands.
Then the user will click the buttons according to the accupoints that
he/shes find that its giving em problem.

When points that the user click will go into the database.

at the bottom of form one., theres a analyse button.

When it is click, it will show form 2

Form 2: Form 2 will show the causes and remedies of the accupoints
that the user click previously.

So, what form 2 will do is to extract the CORRECT info from the corrct
row n column which the user enter.

For eg, If i click the button name Fever, then when i click the Analyse
button, only the causes and remedies of Fever will show. Not others.

So basically thats how i wan it to work.. Hope u can help mi. Thanks
alot..!
 
How are you storing the data in the database? What query are you using to
retrieve it? Can you view the data in the database? Post the code you are
using to do the retrieval.

Chris
 
Hannie,

When I understand you well, is a way you can do it creating an array of
strings and depending of the pushed button is set an index that I have set
global in my program that you do with
\\\
private mystrings() as strings = {"Text1","Text2",etc}
private mybuttonindexer as integer
private da as new Oledb.OledbDataadapter
///
Than using that index you are able to show information in a listbox or a
combobox that is set to dropdownlist.

Than I would in those buttonclick event start a routine as this (the first
item in the array has index 0)

\\\This part in your load event
Dim conn As New OleDb.OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test1\myMdb")
da = New OleDb.OleDbDataAdapter _
("SELECT * FROM MyTable WHERE (ButtonText = ?)
da.SelectCommand.Parameters.Add _
(New OleDb.OleDbParameter("", OleDb.OleDbType.Date))
da.SelectCommand.Parameters.Add _
(New OleDb.OleDbParameter("", OleDb.OleDbType.Date))
////

\\\This as a sub to process after a buttonclick
da.SelectCommand.Parameters(0).Value = MyStrings(mybuttonindexer)
Dim ds As New DataSet
da.Fill(ds)
DataList1.DataSource = Nothing
DataList1.DataSource = ds.Tables(0)
DataList1.DisplayMember = "FistSelection"
DataList1.ValueMember = "RealSelection"
///

Than when the selection is made, use that valuemember to get the second form
information.
However I think that this is enough to start with and when you have done
this you find easily your next steps (it depends what control you use).

This is made in this message to show, so it can contain typos or other
unseen errors.

I hope this helps,

Cor
 

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

Back
Top