Linking a control to access database

  • Thread starter Thread starter CheshireCat
  • Start date Start date
C

CheshireCat

Ive not done any database in dotnet, Ive come from delphi background and
done a bit with that
I'm trying to write a small application for my own use. Ive created a source
database in Access.
Ive been following the help files and examples, dragged an OleDbDataAdapter
onto the form (which created its own OleDbConnection). The help file
finished there.
What do I need to do to attach this to a datagrid object? Once I manage this
I'll be off to a good start.
thanks
 
You need to create a dataset.
In the properties window of the datagrid there is a property called
datasource. select that, and then you will see the dataset you configured.
Then you need to configure the DataMember. (which is right above the
datasource)
then you can use a button or on Form load event to execute the function to
load the data into the grid from the dataset.
Something like
dataset.clear();
OleDbDataadapter.Fill(dataset);
This is the way I have done it. I have seen it done other ways, but I am a
newbie, and I had the same problems..a couple of months ago.
Hope this Helps...
DDF...ONE!!!
 
Thanks Dmension
You made me look at creating a dataset again.
What confused me is that there's no dataset component on the palette. It is
generated from the data menu.
That's great, thanks again
Claire
 
Back
Top