How to show result of store procedure into a grid

Hi all,

              Please help me the solution to show the result of store procedure into a grid. Because I need collect data from many table with conditions and show them in a grid (section or detail).

Thanks

Toàn Mai 

Like 0

Like

2 comments

Dear Toan, 



 

1) Instead of stored procedure you can can create a DB View and use it to display data in a grid as if it were a regular schema.

In this case every time grid is loaded, select to DB view will be performed.

Find details on how to create DB view in step 1 and step 2 in article https://academy.creatio.com/documents/technic-sdk/7-16/localizing-views

 

2) If you still need to use Stored procedure, you can create a regular detail grid and use store procedure to insert/update data to the table.

 

Use StoredProcedure class from Terrasoft.Core.DB namespace to execute stored procedure from a business process.

 

public void RunProcedire(string storedProcedureName) 
{
    var storedProcedure = new StoredProcedure(_userConnection, storedProcedureName);
    using (DBExecutor dbExecutor = _userConnection.EnsureDBConnection())
    {
        dbExecutor.CommandTimeout = 300;
        storedProcedure.Execute(dbExecutor);
    }
}

Kind regards,

Roman

Roman Brown,

Thanks for replying my question, but I need show the result of store procedure into a grid (like section or detail) instead of insert/update in business process. 

About use DB view, please give me more details because I don't know what you mentioned "In this case every time grid is loaded, select to DB view will be performed.". Can I create something like section to show DB view data and can filter?

Toan Mai

Show all comments