Click here to Skip to main content
15,867,835 members
Home / Discussions / C#
   

C#

 
AnswerRe: Synchronization csv file to SQL Server 2008 R2 Database Pin
Mycroft Holmes9-Jul-13 22:49
professionalMycroft Holmes9-Jul-13 22:49 
QuestionTransactionScope in a sub class? Pin
Dominik9-Jul-13 10:36
Dominik9-Jul-13 10:36 
AnswerRe: TransactionScope in a sub class? Pin
Eddy Vluggen10-Jul-13 1:03
professionalEddy Vluggen10-Jul-13 1:03 
GeneralRe: TransactionScope in a sub class? Pin
Dominik11-Jul-13 3:04
Dominik11-Jul-13 3:04 
Questionadd yesterdays value to todays empty value Pin
lordoftrades9-Jul-13 9:53
lordoftrades9-Jul-13 9:53 
AnswerRe: add yesterdays value to todays empty value Pin
Eddy Vluggen10-Jul-13 1:03
professionalEddy Vluggen10-Jul-13 1:03 
GeneralRe: add yesterdays value to todays empty value Pin
lordoftrades10-Jul-13 1:24
lordoftrades10-Jul-13 1:24 
GeneralRe: add yesterdays value to todays empty value Pin
Eddy Vluggen10-Jul-13 6:40
professionalEddy Vluggen10-Jul-13 6:40 
lordoftrades wrote:
This is my code (I guess it's pretty messy...):
It looks more complicated than it needs to be; partly because it's a single method. Divide it in two separate steps;
C#
public override void OnShutdown()
{
    FetchCsvFile(); // downloads from Yahoo, writes result to a file
    ProcessFile();  // loops through all the lines
}
void FetchCsvFile()
{
  // code
}
void ProcessFile()
{
  // code
}

Once you have the CSV as a textfile, it be easy to ReadAllLines[^], without the need to split it at each line-ending. You could loop the result directly.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: add yesterdays value to todays empty value Pin
lordoftrades12-Jul-13 2:23
lordoftrades12-Jul-13 2:23 
QuestionLPARAM value of the usb device Pin
Blubbo9-Jul-13 6:41
Blubbo9-Jul-13 6:41 
AnswerRe: LPARAM value of the usb device Pin
Richard MacCutchan9-Jul-13 10:13
mveRichard MacCutchan9-Jul-13 10:13 
GeneralRe: LPARAM value of the usb device Pin
Blubbo9-Jul-13 10:27
Blubbo9-Jul-13 10:27 
GeneralRe: LPARAM value of the usb device Pin
Richard MacCutchan9-Jul-13 10:50
mveRichard MacCutchan9-Jul-13 10:50 
AnswerRe: LPARAM value of the usb device Pin
Alan N10-Jul-13 4:06
Alan N10-Jul-13 4:06 
QuestionSqlLocalDB in Visual Studio2010 &2012 Pin
dharmaa.m9-Jul-13 2:35
dharmaa.m9-Jul-13 2:35 
AnswerRe: SqlLocalDB in Visual Studio2010 &2012 Pin
Dave Kreskowiak9-Jul-13 4:06
mveDave Kreskowiak9-Jul-13 4:06 
QuestionReason for no display of data in the pdf. Pin
Mausam Bharati9-Jul-13 1:41
Mausam Bharati9-Jul-13 1:41 
AnswerRe: Reason for no display of data in the pdf. Pin
Manfred Rudolf Bihy9-Jul-13 2:25
professionalManfred Rudolf Bihy9-Jul-13 2:25 
GeneralRe: Reason for no display of data in the pdf. Pin
Mausam Bharati9-Jul-13 20:58
Mausam Bharati9-Jul-13 20:58 
Questionlistview Pin
Member 99613129-Jul-13 0:56
Member 99613129-Jul-13 0:56 
AnswerRe: listview Pin
Eddy Vluggen9-Jul-13 3:07
professionalEddy Vluggen9-Jul-13 3:07 
AnswerRe: listview Pin
Jay Nardev11-Jul-13 21:01
Jay Nardev11-Jul-13 21:01 
AnswerRe: listview Pin
Kevin Bewley15-Jul-13 5:41
Kevin Bewley15-Jul-13 5:41 
QuestionMVC Grid Pin
_BrijeshSingh8-Jul-13 23:37
_BrijeshSingh8-Jul-13 23:37 
AnswerRe: MVC Grid Pin
Pete O'Hanlon9-Jul-13 0:35
subeditorPete O'Hanlon9-Jul-13 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.