c# - WPF MS SQL Stored Procedure times out -


my application needs data store procedure. in query program stored procedure works fine;

exec mystoredprodure @prama1 = '01' 

in wpf times out. here code;

using (sqlconnection con = new sqlconnection(constring)) {     con.open();     sqlcommand cmd = new sqlcommand();     cmd.commandtype = commandtype.storedprocedure;     cmd.parameters.addwithvalue("@prama1", "01");     cmd.commandtext = "mystoredprodure";     cmd.connection = con;     sqldataadapter sda = new sqldataadapter(cmd);     datatable dt = new datatable("mystoredprodure");     sda.fill(dt);      foreach (datarow dr in dt.rows)     {        //do code     }     con.close(); } 

it timing out right on sda.fill(dt). should noted select , inserts work fine.

i believe you're missing sda.selectcommand = cmd; before fill. how use dataadapter stored procedure , parameter


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -