Guillermo
Posts: 14
|
Posted: 03/01/2005, 11:18 AM |
|
Hi!
I have three tables (Customers, Orders and OrderProducts). On the editable grid, currently I have set it correctly to delete the selected record of the Orders table. I created a "Before Execute Delete Event" in order to delete the records belonging to that Order just about to be deleted. I have all the code and working, but I need to know how to replace the correct value for the ord_id column in that record that is about to be deleted. Here is what I got right now.
======Code======
Dim Request As HttpRequest = HttpContext.Current.Request
Dim NewDao As DataAccessObject = Settings.MSDBDataAccessObject
Dim Sql As String = "DELETE FROM OrderProducts WHERE ord_id = '{ord_id}'"
NewDao.RunSql(Sql)
======Code======
What I need is the correct code to be placed in {ord_id} that would be the ord_id that I selected to delete.
Any help would be appreciated... thanks
|
|
|
Guillermo
Posts: 14
|
Posted: 03/02/2005, 9:21 AM |
|
Alex A. from Support gave me the answer, in case anyone needs it for later... here it is:
Dim Sql As String = "DELETE FROM OrderProducts WHERE ord_id = '" + item.ord_idField.GetFormattedValue("") + "'"
|
|
|
|