Hi...
I want to know how to user browse and select particular file after than search through database table record if any file (like sql file) exist or not ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Wim SturkenboomPosted Nov 25, 2014, 3:07 AM
Not tried, but I you can use the file upload control to browse for the file. When you submit, you don't have to save the selected file on the server, but instead can get the filename and check if it exists in the database.
Assume you have an upload control called Upl; in code behind, you can get the filename using Upl.FileName.
...
string query = "select * from yourtable where yourfield=@pFilename";
SqlCommand cmd = new SqlCommand(query, conn)
cmd.Parameters.AddWithValue("@pFilename", Upl.Filename);
...
...