How to Call Stored Procedure? (v2020)

hi i use GetStoredProcCommand in 2019 as well but in 2020 i get error

Explain in details how you “use GetStoredProcCommand in 2019”, post your code.

var cmd = ALTable.Connection.GetStoredProcCommand(“USP_ChangePageNumber”+CurrentTable.Name);
cmd.Parameters.Add(“ID”, System.Data.SqlDbType.UniqueIdentifier).Value = rsold[“ID”];
cmd.Parameters.Add(“PersonID”, System.Data.SqlDbType.Decimal).Value = rsold[“PersonID”];
cmd.Parameters.Add(“PageNumber”, System.Data.SqlDbType.Int).Value = s1;
cmd.Parameters.Add(“NewPageNumber”, System.Data.SqlDbType.Int).Value = s2;
if (cmd.Connection.State != System.Data.ConnectionState.Open)
{ cmd.Connection.Open(); }
var df = cmd.ExecuteNonQuery();

Where did you put the code?In v2020, you can simply use, e.g.var df = Execute(“USP_ChangePageNumber” + CurrentTable.Name, new { ID = rsold[“ID”], PersonID = rsold[“PersonID”], PageNumber = s1, NewPageNumber = s2 }, commandType: CommandType.StoredProcedure);// Assume ALTable is a table in the main database

i using it in On_Updating Eventin aspfn 2019 there is a method with name [GetStoredProcCommand] but in 2020 is removedi got error using Execute Too=> An object reference is required for the non-static field, method, or property

I believe GetStoredProcCommand is removed because you can now use the simpler Execute() method.I assume you meant Row_Updating, not On_Updating, server event, then you are using it in the page class, you can try:var df = Connection.Execute(“USP_ChangePageNumber” + CurrentTable.Name, new { ID = rsold[“ID”], PersonID = rsold[“PersonID”], PageNumber = s1, NewPageNumber = s2 }, commandType: CommandType.StoredProcedure);// Assume ALTable is a table in the same database as the table of the page