Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Calling A Stored Procedure From Script Empty Calling A Stored Procedure From Script

Thu 23 Jan 2020 - 16:00
Is it possible to call a stored procedure from script?

Thanks,
Gareth
___________________________________________________________________________________________________________________________________
Code:

Dim DL As FWBS.OMS.EnquiryEngine.DataLists = New FWBS.OMS.EnquiryEngine.DataLists("MYSPDL")
Dim params As FWBS.Common.KeyValueCollection = New FWBS.Common.KeyValueCollection

'Set the params
params.Add("Param1", SomeValue)
params.Add("Param2", FileID)

'Load the params
DL.ChangeParameters(params)

'Run the Datalist
DT = DL.Run(False)

G
___________________________________________________________________________________________________________________________________
Cheers Graham. Given it a go with the following code and get an error (below, line 36 is the last line of the code):
Code:

FWBS.OMS.OMSFile CurrentFile = Enquiry.Object as FWBS.OMS.OMSFile;
System.Data.DataTable _dt = new System.Data.DataTable();
FWBS.OMS.EnquiryEngine.DataLists _dl = new FWBS.OMS.EnquiryEngine.DataLists("UDDSUPDSPECDAM");
FWBS.Common.KeyValueCollection _kvc = new FWBS.Common.KeyValueCollection();
_kvc.Add("fileid", CurrentFile.ID);
_dl.ChangeParameters(_kvc);
_dt = _dl.Run(false);

"error: Cannot implicitly convert type 'object' to 'System.Data.DataTable'. An explicit conversion exists (are you missing a cast?) Line 36"

Gareth
___________________________________________________________________________________________________________________________________
Code:

_dt = _dl.Run(false);

//Would need to be cast into the DataTable object
_dt = (System.Data.DataTable)_dl.Run(false);
___________________________________________________________________________________________________________________________________
Massive thanks to both, working great now. Thanks.Gareth
Back to top
Permissions in this forum:
You cannot reply to topics in this forum