"mark blackall" <bl******@btinternet.comwrote in message
news:ed*******************@news.demon.co.uk...
Hi all,
I am new to vb.net and I am trying to use the vb.net components, rather
than relying on the VB6 compatibility stuff with which I am more familiar.
However, I seem to have fallen at the first hurdle. I have created a
dataset linked to a single SQL table and would like to iterate through the
records in it, it, changing one of the fields as I go, but I can't seem to
find a way of doing this. I guess all the records are in a collection of
some sort but I can't seem to access them.
Any help gratefully received.
Thanks
Mark
Oops, ignore my previous post...darn shift-enter!!!
What helps me is looking at DataSets as small, in-memory databases. Each
DataSet can contain one or more DataTable instances. Each DataTable contain
DataRows. The rows, when updated, do NOT update the SQL Server (or other
dbms) automatically. Instead, the in-memory db (DataSet/DataTable/DataRow)
is updated. When you want to commit (Update) the real dbms, you will need
to connect to the database (if no connection exists already), and using the
DataAdapter (ie: SqlDataAdapter) call the appropriate Update/Insert methods
passing either the DataRow, DataTable, or DataSet (forget which is
required).
Once you do get a handle on ADO.Net, I would recommend looking into the
Microsoft Patterns and Practices Enterprise Library Application Blocks (more
specifically, the Data Access Application Block). These blocks help
streamline code you would normally write to help normalize database
connection and access.
HTH,
Mythran