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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -