Hmm then I may have have understood you wrong.
I thought you meant that SQL-statement were automatically generated by a function that dynamically writes the statement based on it's input (seen it once on a site).
Er.. Youve lost me. Here it is again: MS have a tool that is quite clever. You tell it what table you want to read and write and it looks at the table, looks up the primary key, uses some sensible logic to work out the statements that will download data from that table, and also update data to it* and it.. er.. writes them in a good, parameterized, logical, well encapsualted way. In seconds
*the logic is:
SELECT * FROM table
INSERT INTO table VALUES(<parameters>))
UPDATE table SET <fields = parameters> WHERE <primary key fields = original parameters>
DELETE FROM table WHERE <primary key fields = original parameters>
As you can see, PK is essential for the tool to work out the queries to update the rows
Adding these items, like the simple method, by hand ofcourse works but I know that I eventually want to go further so therefore I thought, why don't learn it the how I should write more professional apps?
Well, the grammar in that sentence got me a bit confused, but really the proper way to write OO (object oriented) software is to have all your stuff in relevant places. If you have a class that represents your Car, dont store the colour of your car in the Garage class.. Its an attribute of the car. Similarly, your button handler code is for doing a small amount of GUI related code. It is not for building connection strings, opening databases, reading select statement output etc. This is the concept of encapsulation.. a bit like tidying your house. Sure, throwing everything you own on the floor is an organizational style (preferred by teenagers it would appear) but eventually you realise that putting books on the book shelf, dvds in the dvd cabinet, newspapers in the paper basket and food in the fridge is a good idea
I've ordered a book which should be delivered on friday so I have a basis from where to start. Just searching for some tutorials to learn a programming language is not the way to go.
Quick tip.. If that book is advertised as .NET 2 and the data access sections mentions the words "DataAdapter" (it should mention "TableAdapter") or "CurrencyManager" (it should mention "BindingSource") or refers to datasets like this:
Dim ds as New DataSet
ds.Tables("MyTableName").Rows
Instead of this:
Dim myDS as New MyTypedDataSet
myDs.MyTableName.Rows
Then return it for a refund