I have 2 tables in sql , one is called stock and the other stock warning
the stock table has columns ' Pid, pdescr,current stock, stock warning' this shows up in datagridview
2nd table(stock warning) has columns 'pdescr, current stock' showing in datagridview
in the stock table when the 'current stock' is less than the set 'stock warning ' number , i want the pdescr and current stock data to show in the stock warning table sending the data to the datagridview
how can this be done?

Recommended Answers

All 3 Replies

Do you want to actually copy the data from one table to another or just display it on the screen that way? If you just want to display it, you might consider creating a view in the database.

i just need to display the data in the data gridview and maybe then add a print button so someone can print off if required.

Member Avatar for Rahul47

When you update the Stock Table on Some Event, it should check if the Current Stock <= Warning Stock. And If that is True then Put a query updating Stock Warning table with Current Stock and pdecr Values.
And then populate the DataGridView

Do mention on which event you wish to Update the stock table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.