Question Attach file in Visual Studio 2010

szaszpi

New member
Joined
Jan 8, 2013
Messages
4
Programming Experience
Beginner
Hi.Im trying to learn how to attach a file to the form.The idea is, the user can not only add a record but will also be able to add an attachment for that particular record. Lets say I would like to add an excel or word doc. This has nothing to do with sending attachments and emails and stuff like that, just attaching a file (or two) to the form. This may be trivial to most of you but its a headache for me as the reference books i read offered no such help and online research don't offer much clarity.Most of the results of my search are about sending and receiving attahments through email. Is it possible to put in attachments on the fields in datagrid too?Can anyone please help me?
Oh and i use VB.Net.
 
You're not attaching a file to the form. What's the idea here? Are you saving records to a database and you want to associate attachments with those records? Do you want to be able to save an arbitrary number of files against a record? What database are you using?
 
I wish to make an electronic order program, so i want the users to fill the blank textboxes, and attach an exel or word doc. When they saved the filled form, i want to be able to list the ordered items, and open the attached file. My problem is that i don't know which control to chose to make it.
 
The user would select a file, for example with OpenFileDialog, and you would keep the file path for later use. The selected file path can be presented in UI with just a Label control, or a Listbox or something like that for multiple files. The later usage of the file path can be anything, for example it can be used to add attachment to an email when that is to be sent.
 
I tried it but i failed. Can anyone please show me a VB.NET sample how to attach word file in VS 2010 and make others to download with a save dialog box. Thanks!
 
How about we do it the other way around? How about you show us what you tried and then we can help you fix it? That's the best way to learn. It may be that you're most of the way there so you don't actually need someone else to do the whole thing for you.
 
Back
Top