Procedure or function 'storedprocname' expects parameter '@Param1', which was not supplied.
Hello Community,
Even when supply parameter, get error as " Procedure or function 'storedprocname' expects parameter '@Param1', which was not supplied."
Below is the code snip.
Thank you
var AConnection, RecSet, Cmd, Prm;
// Create a new Connection object
AConnection = ADO.CreateConnection();
// Specify the connection string
AConnection.ConnectionString = "Provider=MSOLEDBSQL.1;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
// Activate the connection
AConnection.Open();
// Create a new Command object
Cmd = ADO.CreateCommand();
// Specify the connection
Cmd.ActiveConnection = AConnection;
// Specify command type and text
Cmd.CommandType = adCmdStoredProc;
Cmd.CommandText = "StoredProcName";
// Create a new parameter
Prm = Cmd.CreateParameter("@Param1", adDBDate, adParamInput, "20220101");
Cmd.Parameters.append(Prm);
// Execute the command
RecSet = Cmd.Execute();