0

I have a script as follows:

drop table edictEquityPrices.F;

create table edictEquityPrices.F(
    `date` date
    ,`F.Open` double
    ,`F.High` double
    ,`F.Low` double
    ,`F.Close` double
    ,`F.Volume` double
    ,`F.Adjusted` double
);

LOAD DATA LOCAL INFILE 'B:\\EDICT I\\EQUITYdata\\F.csv' 
INTO TABLE edictEquityPrices.F
FIELDS TERMINATED BY ','
ENCLOSED BY '"' 
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(   
    `date`
    ,`F.Open`
    ,`F.High` 
    ,`F.Low` 
    ,`F.Close` 
    ,`F.Volume` 
    ,`F.Adjusted`
);

And my code to execute it:

private void button1_Click(object sender, EventArgs e)
{
    string connString = "datasource=127.0.0.1;port=3306;username=root;password=XX";
    MySqlConnection connDatabase = new MySqlConnection(connString);
    string query = File.ReadAllText("B:\\SCRIPTS\\SQL\\F.sql");
    MySqlScript script = new MySqlScript(connDatabase, query);

    //script.Delimiter = "$$";
    //connDatabase.Open();
    //script.Execute();     
}

I have spent several hours digging and I can't get a solid answer. I keep getting cryptic errors regarding MySql.Data, but nothing gets me anywhere when searching.
Please tell me what I am missing here and where I can go cheaply make some progress and learn to program.

-H

Rob
  • 26,989
  • 16
  • 82
  • 98
  • You should set `script.Delimiter = ";";` before executing it. What are the errors you are getting? – Harsh Dec 02 '15 at 01:12
  • post a 10 row CSV on the net or here. And don't be so harsh on yourself :P – Drew Dec 02 '15 at 01:14
  • Can you please post the error you are getting, cryptic or not? It's quite difficult for us to give you an answer without any information regarding the error. – Rob Dec 02 '15 at 01:18

0 Answers0