Look at your code:
Response.TransmitFile(HttpContext.Current.Server.MapPath("~/db/"));
Does not specify a file: it specifies a folder "db" which resides in the main site folder.
You can't "send a directory", just a file. Use
Path.Combine[
^] to add the actual filename to the end of that before sending ...
And in future do us all a favour. Don't just "dump" your code on us: format it using the
pre
tags via the
code
widget above the text box so that the formatting is preserved and the syntax highlighter engaged. And delete commented out code as well - it's of no use to us!
As it is, you need to re-indent that correctly (CTRL + K, D will do it) and then you might see that you send the bytes and the file together anyway.