none
Autorun functions using C# RRS feed

  • Question

  • I have a sql database table(4 columns) which contains data about the company stock.

    Stock_Table(Item_no,Item_Name,Quantity,Unit_Price)

    Every time if the quantity of an item is less than 10 in the table 'Quantity' column, i want to notify the user about that item.

    This method should run each time the software is started.


    Tuesday, September 10, 2019 1:26 PM

Answers

  • When your app starts call a function to check the quantities. This can happen anywhere during startup depending upon the type of app you have. As for how to do that it completely depends upon what data access technology you are using. But ultimately you'll just query the table (just like in SSMS) for any items with a `Quantity` < 10. Enumerate the results you get back (`foreach` or `ExecuteReader` depending upon what you're using) and then do whatever you need to for each one.

    If you need more than this then please post the code you already have. We don't provide full solutions in the forums.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, September 10, 2019 1:39 PM
    Moderator