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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Wim SturkenboomRank #2,527 · 554 reputationPosted Nov 24, 2014, 10:07 PM EST
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);
...
...