Last post Dec 29, 2010 12:11 AM by Pratik N
Dec 24, 2010 03:31 AM|n3xus|LINK
I have dropdownlist which items are generated using SQLDataSource.
And there is a "Delete Button" next to it.
When user selects item from dropdownlist and presses that button I want the item to be removed from DB.
Here is the question "How can I achieve this using sqldatasource Delete Command?"
I do can remove Item From Code Behind. But i believe it's more efficient to use sqldatasource delete command.
Dec 24, 2010 07:52 AM|Nayan Chavada|LINK
write code in selected index change event
string searchItem = DropDownList.SelectedItem.Text;
use this query to delete item from DB
string mySQL = "delete from mytable where [product] =" searchItem;
I hope u have got this answer
Dec 29, 2010 12:11 AM|Pratik N|LINK
Your Question is very easy to solve.
This Question is perfectly can be solved if you give us some your ASP.Net Page Code.
Without knowing what is field in dropdownlist the SQL query can not be written.
please post atleast dropdown list page code of ASP.Net