I'm sharing a snippet from my code below:
string str = "select * from contacts";
DataSet dt = Global.getdatatablefromquery(str);
ExcelGrid.DataSource = dt;
ExcelGrid.DataBind();
I am changing all my queries to stored procedures, but I don't know exactly how will I define my stored procedure in this code? I want something like:
string str = "storedprocedurename";
DataSet dt = Global.getdatatablefromquery(str);
ExcelGrid.DataSource = dt;
ExcelGrid.DataBind();
Global.getdatatablefromquerymethod? If so, just change yourCommandTypetoStoredProcedure.