i need a code sample to capture the value of a record id from the selected row so that i can send it as a parameter to the oracle procedure that deletes the record.

thanks

Recommended Answers

All 2 Replies

What do you have so far? How much do you know about the underlying DataRowView model to a GridView?

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdeleting.aspx

The trick is when the event triggers, it will return a DataRowView that you can pull data from. You just have to figure out the column you want.

This page should provide some insight if you view the source via the link at the bottom of the page:

http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/gridviewrowdeleting.aspx

if ur control is a grid view then the code to capture the selected row's id in a string is:
string str = GridView1.SelectedDataKey.Value.Tostring()
Note: Set the Datakeyname from the propertiers of the GridView control to your table's id name and then write the above line of code in gridview's selectedindex change event

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.