c# - Direct method from Stored Procedure command text to DataSet? -
private void data_load(object sender, eventargs e) { commonclass_runprocesses commoncls = new commonclass_runprocesses(); dataset ds = new dataset(); ds = commoncls.executesql("select sales = sum(sales) sales_1 ", 17); if (ds != null) { if (ds.tables[0].rows.count > 0) { grddata_load.datasource = ds.tables[0]; grddata_load.allowusertoaddrows = false; grddata_load.autoresizecolumns(datagridviewautosizecolumnsmode.allcellsexceptheader); }
how can give storedproc instead of sql command time. need give sp name usp_salesofest ????
try this:
ds = commoncls.executesql("exec usp_salesofest", 17);
this fastest change without knowing other things commonclass_runprocesses
class can do. if has special built-in method running sps, should check them out.
Comments
Post a Comment