Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySQL C# Load data infile.. (no replies)

$
0
0
Hello all,

I've a question, when I use a sql command to set up a LOAD DATA LOCAL INFILE query in C#, I need to format the date (from 11/11/2000 to 2000/11/11). So I need a "@" to fix the format:

LOAD DATA LOCAL INFILE 'test_123.csv'
INTO TABLE test_123
FIELDS TERMINATED BY ','
IGNORE 1 LINES

(@Date, column1, column2, ...)
SET date = str_to_date(@Date, '%m/%d/%Y')

When I execute the query in the query browser of MySQL administrator, it works fine. When I declare this in c#, he gives a fatal error exception because the "@" is used to declare a sql parameter (The error says: "You need to define the @Date parameter"). I think this is a tricky one, can you help me with this problem?

Thanks in advance!
Thijs

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>