C# Find out what column caused the Sql Exception
Posted
by PaN1C_Showt1Me
on Stack Overflow
See other posts from Stack Overflow
or by PaN1C_Showt1Me
Published on 2010-05-12T08:33:04Z
Indexed on
2010/05/12
9:04 UTC
Read the original article
Hit count: 238
Hi. I'm getting an exception from SQL Data Reader (MS SQL as datastore) and I'd like to know which column name causes this Exception to be thrown. But I cannot find it in the InnerException.. nowhere.
((System.InvalidOperationException)ex.InnerException).StackTrace:
System.Data.SqlClient.SqlDataReader.ReadColumnHeader(Int32 i)
System.Data.SqlClient.SqlDataReader.IsDBNull(Int32 i)
...
Where is it hidden please ?
© Stack Overflow or respective owner