GST Billing Software

header image

Custom Operations on a Database

Erachana Line

38. How to do custom operations on a Database?

In Kushal, we have a provision to run our own database queries, like SELECT, INSERT, UPDATE, DELETE etc.

To do this, use the following functions in the SQLInterpreter Class.

1. ExecuteSQL -This function will help us to do database manipulation queries.

Syntax : SQLInterpreter. ExecuteSQL (Query)

This function will return 0 or 1. 0 means not executed. 1 Means Executed Successfully.

Example -

int result = SqlInterpreter.ExecuteSQL("update BillDetails set TaxRate=0 where BillId=1");

2. GetData - This function will help us to get the data from the database.

Syntax - SQLInterpreter. GetData (Query)

This function will return DataTable.

Example -

DataTable dtShip = SqlInterpreter.GetData("select StateID from BillShipTo where BillId=1");