3.4 Выполнение SQL функции
5 мая 2025 г.
12:03
Using reader = runner.SqlExecute("QER_FGIPWOOrderPerson", {
QueryParameter.Create("@uidperson", strUID_Person),
QueryParameter.Create("@uidaccproduct", UID_AccProduct)})
While reader.Read()
EmpCanOrderProduct = reader.GetString(0)
End While
End Using
Steps to provide a Predefined SQL statement
- Create a predefined SQL statement in the Designer that is using the SP
- Assign a permission group to the predefined SQL statement that is allowed to use it
- Use the predefined SQL statement in your DialogScript
Dim runner = Session.Resolve(Of VI.DB.DataAccess.IStatementRunner)()
Using reader = runner.SqlExecute("CCC_getUser", {QueryParameter.Create("accountID", 42)})
While reader.Read()
' Do normal IDataReader stuff here
End While
End Using
You can access the columns in the reader using either the index or the name of the column as described here https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/retrieving-data-using-a-datareader (or in several other online articles around accessing data using DataReader).
For example:
reader.GetString(0)
reader.GetInt32(1)
reader("columnname").ToString()
* *

