ObservableCollection Data to CSV - Helpme solve Bug
$10-30 USD
Πληρώθηκε κατά την παράδοση
I'm using an ObservableCollection in my application; and I export that data to CSV. The export function works well ONLY the first time I export the data. The second time I export the data, the columns get different - but still exports.
I need you to fix that bug, and help export all the data in the collection in the same order the columns are originally.
Sample Code:
public static IEnumerable<string> ToCsv<T>(IEnumerable<T> list)
{
var fields = typeof(T).GetFields();
var properties = typeof(T).GetProperties().OrderBy(p=> "Time");
foreach (var @object in list)
{
yield return [url removed, login to view](",",
[url removed, login to view](x => ([url removed, login to view](@object) ?? [url removed, login to view]).ToString())
.Concat([url removed, login to view](p => ([url removed, login to view](@object, null) ?? [url removed, login to view]).ToString()))
.ToArray());
}
}
When I click Export Button:
using (var textWriter = [url removed, login to view](fileName))
{
string header = "Header Title Here"
[url removed, login to view](header);
foreach (var line in ToCsv([url removed, login to view] as ObservableCollection<[url removed, login to view]>))
{
[url removed, login to view](line);
}
}
Ταυτότητα Εργασίας: #16919168
Σχετικά με την εργασία
Ανατέθηκε στον:
Hello, I am an expert in c# and I can fix this for you within minutes. Available to do it now. Regards
6 freelancers κάνουν προσφορές κατά μέσο όρο $55 για αυτή τη δουλειά
Hi. I am an expert in VBA, VBScript, Visual Basic, C#, F#, C, C++, ASM, Delphi, Java, iMacros, Flash, ASP, ASP.NET, Access, MySQL, MSSQL, QuickBooks, Oracle. I can create auto scripts to scrape websites, auto click, fo Περισσότερα
Can I see your code? I may have an idea for this, I want to check something and if it is working I will let you know! Please contact me