Description of Problem:
Small, but it made my application crash. I guess Mono is right about this and MS isn't, but may be Mono could be the wise party. Error is "invalid attempt tp read from column..." (sic)
Steps to reproduce the problem:
1. Make a System.Data.SqlClient.SqlDataReader
3. Test if field(0) is null with IsDBNull
4. Try to get the value of field(0)
If DataReader.IsDBNull(i) Then
msgbox (DataReader(i)) ' ordinal0
Error, because you are reading the same field twice.
Actually, what Mono does, but my application didn't like it. "Workaround" in VB something is something like:
Dim obj As Object = DataReader(i)
If TypeOf (obj) Is System.DBNull Then
FieldValue = ""
FieldValue = CStr(obj)
How often does this happen?
Once until solved
As the error message has a spelling error, the source is probably easy to find. "invalid attempt tp read from column".