954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Saving a csv

Hi all,

The project I am currently working on is an Address Book which works off a csv (specification takes the mick as a database would be so much easier), the method to write the lines of information into the CSV is in the class DataLayer and takes a String: filepath and an AddressBook: addressbook.

My question is how do i get the filepath selected from a savedialog and pass it through to the method in the class as I cannot see how using intellisense and MSDN.

Thanks,

Mike

MikeyIsMe
Junior Poster
142 posts since Nov 2010
Reputation Points: 32
Solved Threads: 15
 

It really depends on the class interface.
It also depends on your actual question.

Are you asking how to get the filepath FROM a save dialog box?

SaveFileDialog sfd = new SaveFileDialog();
sfd.ShowDialog();
MessageBox.Show(sfd.FileName);


Are you asking how to pass the filepath to the class?
This will REALLY depend on the constructor of the class.

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 


Ooooh filename passes both the path and name? Thats where I was going wrong :) Thankyou very much thines

MikeyIsMe
Junior Poster
142 posts since Nov 2010
Reputation Points: 32
Solved Threads: 15
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: