c# - MySQLBulkLoader not inserting any row in mysql db -
var bl = new mysqlbulkloader(mycon); bl.tablename = "tblspmaster"; bl.fieldterminator = ","; bl.lineterminator = "\r\n"; bl.filename = "e://31october//sp//sp_files_sample1//400k sp00 6-19 e.csv"; bl.numberoflinestoskip = 1; var inserted = bl.load();
i using code upload csv file in db not throwing exception , inserted show 0 .
dotnetconnector mysql installed , reference added .
finally have used code , working me
string sql = @"load data infile 'e:/a1.csv' ignore table tblspmaster fields terminated '' enclosed '' lines terminated '\n' ignore 1 lines (sp)"; mysqlcommand cmd = new mysqlcommand(sql, mycon); cmd.commandtimeout = 5000000; cmd.executenonquery();
Comments
Post a Comment