c# - Can you trace the source for a Timeout expired error? -


i have 2 identical sql server databases - staging (version 10.0.4000.0) , testing (10.0.2531.0).
have visual studio 2008 asp.net, c# project calls these databases. project uses .xsd return data stored procedures.

there on 100 stored procedures in project , works great. however, created stored procedure giving me issues. stored procedure runs in both databases qa. when create table adpater xsd , connect testing db, runs expected. when change connection staging db, error:

timeout expired. timeout period elapsed prior completion of operation or server not responding.

the procedure requires 2 date parameters. if remove date paramters, error goes away , expected result set. if put in bogus string or integer parameter, runs. if require dates, timeout error occurs. keep in mind stored procedures identical in test , staging , both return results (in 3 seconds) when run in qa. i'm clicking on tableadapter , selecting preview data option know can't mistake in presentation code.

i'm not sure code provide or might solve issue. please let me know details may , can provide.

update: here full message returned visual studio:

mw.mwdepttotalspend.fill,getdata (@startpymnt_dt, @endpymnt_dt) not previewed.

timeout expired. timeout period elapsed prior completion of operation or server not responding.

update 2:

i made small change in sproc may give insight.

where x.pymnt_dt between '1/1/2014' , '5/1/2014' --@startpymnt_dt , @endpymnt_dt 

the commented parameters defined @startpymnt_dt smalldatetime, @endpymnt_dt smalldatetime

the procedure returns data now, want pass in date parameters.

i found "solution." reason, had cast datetime parameters datetime in sql:

x.pymnt_dt between cast(@startpymnt_dt smalldatetime) , cast(@endpymnt_dt  smalldatetime) 

i still know how trace source of these errors, , solution hack. willing accept better answer if can supply one.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -