Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
looping through rows in datagrid to save to database
The function of my form is to generate an order. i am doing this by populating several rows of a datagrid. I have little experience with datagrids and i wish to save the contents of the datagrid, having gone through several validations (eg ensure every cell has been filled out, is there enough quantity in stock etc). i am wondering how to loop through each row of the datagrid, first to validate and then to save each row to the database? is it something like:
for row 1 to ? ( i am unsure of what to put here as the number of rows that will be in the order cannot be predetermined)
perform validation and saving......
how do i declare the rows in the datagrid?
any help would be much appreciated! Thank you!
0 · ·