save value of datagrid into MYSQL
Posted: Wed Mar 12, 2014 8:34 am
I 'm able to save in this way but it will only create one row. I have more than one row in my datagridview. i want that every row of my datagrid will be save according to its row.
Code: Select all
put the dgData of group "dgGridMed" into theDataA
put the dgIndexes of group "dgGridMed" into theIndexes
#& cr after
repeat for each item theIndex in theIndexes
put theDataA[theIndex]["Medicine"] & cr after Medicine
put theDataA[theIndex]["Preparation"] & cr after Preparation
put theDataA[theIndex]["dosage"] & cr after dosage
put theDataA[theIndex]["Frequency"] & cr after Frequency
end repeat
put "insert into hos_tblmedicineOrder(medName,preparation,dosage,frequency) values (' " &\
Medicine &" ' , ' " & Preparation& " ' , ' " &dosage & " ', ' " & Frequency& " ' )" into sqlQuery
revExecuteSQL connID,sqlQuery