Using the methods of the SqlDataReader method , I can get the column value by passing it a serial number, for example, the value of the first column if I go through read.GetValue(0), or the second column if I go through read.GetValue(1).
When looking at methods, I don’t see the possibility of getting the column value by passing the column name, for example ColumnID. In my mythical example, I would like to go through read.GetValueofColumn("ColumnID")and read the value in the column ( note that the method GetValueofColumndoes not exist, as far as I can tell from the list of methods ).
Am I missing a method for this or a way to do this?
source
share