Naresh_Surya
5 years agoOccasional Contributor
How to pass Date as in parameter for stored proc
I tried below code // Adding a return parameter SProc.Parameters.AddParameter() SProc.Parameters.Items(0).name = "RETURN_VALUE" SProc.Parameters.Items(0).DataType = adInteger SProc.Parameters.It...
- 5 years ago
Try to run it with this peace of code:
var sql = ` // sql or procedure `; var conn = ADO.CreateCommand(); conn.ActiveConnection = connectionString; conn.CommandType = adCmdText; conn.CommandText = sql; conn.CommandTimeout = 6000; try { var exe = conn.Execute(); } catch(exception) { Log.Message("FAIL"); }
- 5 years ago
Sure Wamboo .
// Adding a return parameter
SProc.Parameters.AddParameter()
SProc.Parameters.Items(0).name = "RETURN_VALUE"
SProc.Parameters.Items(0).DataType = adInteger
SProc.Parameters.Items(0).Direction = adParamReturnValue
SProc.Parameters.Items(0).Value = null
//Adding an in parameter
SProc.Parameters.AddParameter()
SProc.Parameters.Items(1).name = "@timeOfBuild"
SProc.Parameters.Items(1).DataType = adDate
SProc.Parameters.Items(1).Value = aqConvert.strtoDate("2020-05-19")
SProc.CommandTimeout = 75;
SProc.ExecProc();