Mondeo
Centurion
I have a simple database app, tab 1 has a datagrid on which is filled simply with SELECT * FROM Customers into a dataset/datatable which is then bound to the grid.
Then if I double click a row it moves to tab 2, looks up cell 1 on the selected row of the datagrid (which is the primary key) and then does "SELECT * FROM Customers WHERE ID=id" into a datareader.
On tab 2 I have loads of text boxes and I simply do
txtname.text = rdr.item(0).tostring
txtcompany. text = rdr.item(1).tostring
And so on.
Could someone explain the correct and accepted way of doing this task, i.e. using databinding etc. Should I create a customer class first with properties for my database fields? Then how to I do the binding etc.
Thanks
Then if I double click a row it moves to tab 2, looks up cell 1 on the selected row of the datagrid (which is the primary key) and then does "SELECT * FROM Customers WHERE ID=id" into a datareader.
On tab 2 I have loads of text boxes and I simply do
txtname.text = rdr.item(0).tostring
txtcompany. text = rdr.item(1).tostring
And so on.
Could someone explain the correct and accepted way of doing this task, i.e. using databinding etc. Should I create a customer class first with properties for my database fields? Then how to I do the binding etc.
Thanks