Click here to Skip to main content
15,893,588 members

Comments by shailesh_pujara (Top 13 by date)

shailesh_pujara 4-Nov-14 9:53am View    
Actually I realize final statement is worthless - because I return empty or filled datatable if no exception arise and nothing in case of exception. So final has no impact in the code. Actually code should be
Dim dt as new datatable '' will be empty - nothing
Try
fill table
Catch
Finally
dispose connection, command objects
end try
return dt ( empty in case of no rows return or exception arise)

But this way also, the datatable is empty as cmd.executereader() return no row.
shailesh_pujara 4-Nov-14 9:46am View    
yes - datatable get filled only when datareader.hasrows - I set debug point there and checked - datareader.hasrows = false. In any case if it is success full - datatable return before the final statement hits.
shailesh_pujara 4-Nov-14 6:14am View    
but before going to finally - dr.hasrows is false.
shailesh_pujara 3-Nov-14 23:56pm View    
The code should works as it works in SSMS. But not works at my end. I thought, it might be my mistake at SQL Server - but database correctly collated and the query and even stored procedure call works fine in SSMS. Just it do not works when I do the same thing from ADO.Net.
shailesh_pujara 3-Nov-14 23:52pm View    
in any way result dr.hasrows = false