c# - Error not thrown while executing query -


we executed below sql command using system.data.sqlclient.sqlcommand , assigned sqldata reader.

select distinct cast([reg].[pin]  float) [pin] [reg] 

here datatype of column 'pin' nvarchar , contains string data also. while executing query no error thrown , reader hasrows property returned false, when reader.read done error thrown.

normally if query contains error while executing error thrown, above query why behaving differently?

because sql thinks fine @ first instance. when reads data , tried parse read during reader.read error thrown.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -