Do anyone know how to manipulate the process so I don't have to write all the fields manually?
I wonder if I can use loop on the dataReader by using dataReader.VisibleFieldCou
nt and get the field name by dataReader.GetName().
as you can see the object name is the same as the dataReader's field name, but the case is not same.
The myTable field object using proper case and the dataReader field's name using camel case.
I hope my description are clear enough. Sorry my english is not very good since english is not my first language :).
System.Data.SqlClient.SqlDataReader dataReader = null;
dataReader = getDate()
myTable = new MyTable()
myTable.CustNo = dataReader["custNo"];
myTable.CustName = dataReader["custName"];
mytable.CustAddress = dataReader["custAddress"];
myTable.PhoneNo = dataReader["phoneNo"];