.net - Better approach to execute procedure at Dot Net front end -


i have form built in c#.net , has got approx 40 controls, controls datavalues comes sql server database. of following better approach

  1. write 1 procedure , add queries each controls in procedure execute sequentially , result dataset , loop controls , bind each datatable.

for example:

connection.open  dataset ds = executeproc("someproc") control1.datasource=ds.tables(0) control2.datasource=ds.tables(1) control3.datasource=ds.tables(2) . . . . connection.close 
  1. write procedure each control , bind them, threading technology execute parallely, in case each procedure need open , close connections each procedure when executed.

for example:

all running parallely:  connection.open dataset ds = executeproc("someproc1") control1.datasource=ds.tables(0) connection.close  connection.open dataset ds = executeproc("someproc2") control2.datasource=ds.tables(0) connection.close  connection.open dataset ds = executeproc("someproc3") control3.datasource=ds.tables(0) connection.close 

can me getting answer proposed methods or there other better approach achieve @ faster rate?

thanks in advance

the second approach better one. opening/closing connection cheap operation because of connection pooling. creating connections big guy.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -