A little green when it comes to C# so I would really appreciate some help on this. I keep getting this error on this part of my code.
Error 1 The best overloaded method match for 'FileHelpers.FileHelperEngine.ReadString(string)' has some invalid arguments C:\Users\Traci\Documents\Visual Studio 2013\Projects\SpectraMX\src\SpectraMX.app\Program.cs 26 45 SpectraMX.app
static void Main(string[] args)
{
//get data from my ftp site
string data = getDataFromFtpSite();
//go through the records there
FileHelperEngine <FtpProductRecord> engine = new FileHelperEngine<FtpProductRecord>();
FtpProductRecord[] FtpRecords = engine.ReadString(getDataFromFtpSite);
//for record requested below, write it
foreach (var product in FtpRecords)
{
Console.WriteLine(product._UPC);
}
The second error I get is:
Error 2 Argument 1: cannot convert from 'method group' to 'string' C:\Users\Traci\Documents\Visual Studio 2013\Projects\SpectraMX\src\SpectraMX.app\Program.cs 26 63 SpectraMX.app
When I run without debugging as is, I'm getting ALL of the data in the text file instead of just the UPC portion of it I requested. My data is separated by a semicolon in the text file and I have it shown as [FileHelpers.DelimitedRecord(";")]. Ive looked this up on FileHelpers and it looks to me like Im doing it right. http://www.filehelpers.net/quickstart/ A little help would be much appreciated.
You must use data in the ReadString method:
I recommend to update to last version of the library at
http://www.filehelpers.net/download/