Get fileupload filename from edittemplate in listview

How would I get the Filename of a FileUpload control which is in an edittemplate of a listview ... I need to store the value in a db. The listview is populated with a sqldatasource, which handles all the selection and updating, so I am not sure how to capture its value on the listview update (how to bind it to datasource)  ...
I have tried what I have attached, but not working.

Thanks you
protected void ImageListings_OnUpdating(object sender, SqlDataSourceCommandEventArgs e)
        {
            
            FileUpload FileToUpload = (lvImages.FindControl("ImageEditFile") as FileUpload);
            if (FileToUpload.HasFile)
             {
                 e.Command.Parameters["@image"].Value = FileToUpload.FileName;
             }
        }

Open in new window

simshpAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
Option 1: User LV ItemUpdating event

protected void lvImages_ItemUpdating(object sender, ListViewUpdateEventArgs e)
    {
        FileUpload FileToUpload = (lvImages.Items[e.ItemIndex].FindControl("ImageEditFile") as FileUpload);
            if (FileToUpload.HasFile)
             {
                ImageListings.UpdateParameters["@image"].DefaultValue= FileToUpload.FileName;
             }

    }

Option 2 is try similar inside onItemCommand of LV

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
simshpAuthor Commented:
Thanks that did it ... just needed to remove the @ from @images
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.