SQLDataSource and SPROCS
I'm a bit stuck with what I'm trying to do. I want to respond to a user's selection in a gridview by taking the selected value and passing it as a parameter to a stored procedure which will return a value.
To be more precise: the gridview contains a list of names. When the user clicks on a name, I want to pass that name to a stored procedure that will return the filename of a .JPG with that person's picture, so that I can display the picture of the person he just selected. (There are thousands of images, so the database query determines the filename of the image I need.)
The sqlDataSource interface doesn't seem to give me the freedom I need to pass in the parameter. I need to know how to write server-side code that will
* grab the selected name, from grid1.SelectedRow.Cells(3).Text,
* send it to the stored procedure, where name is the sole input parameter,
* retrieve the result (filename as string) which is the sole output parameter,
* and display the image on some control (e.g. img1.src="myPic.JPG")
Please help! (and Thanks in advance) :)
|