I have a gridView and I have bound it to SQLdatasource which contains SELECT command (to display data in GridView). I tried adding DELETE command in the SQLDataSource wizard. But when the wizard asks for parameters value definitions, it does not ask for the parameters that I have used in DELETE command.
How to define parameters for that DELETE command?
one parameter is from the value displayed in gridview.
P.S: SELECT command uses data from two separate tables in a join query.
CODE:
SELECT Document_Name, Document_Path FROM Document_Details WHERE (Document_Id IN (SELECT Document_Id FROM Favourite_Documents WHERE (E_Id = @parameid))) DELETE FROM fovourite_documents WHERE (E_id = @parameid) AND (document_id = @paramdocid)
It asks only for parameters present in SELECT and not in the DELETE statement
Found something:
some problem in SO. sorry look here for code: http://pastebin.com/rCYSiK5V
In this code, I manually added SessionParameter for parameid in DeleteParameters.
Now, I want it to take the paramdocid value from the currently selected row's primarykey. how do i do it?