我在我的文件中有这些数据(有时字段可能是双引号),如下所示:
1, "ala", johnes, 2017-09-01, 100
2, dqwdqdq,, 2017-09-01, 101
数据已加载到数据库,但引号也会插入到列中,因此要查看ala
我在列中看到"ala"
。
我的代码:
Using exclecon As New MySqlConnection("Server=Localhost;DataBase=mobily;user=root;password=897;")
Dim uploadQry As String = "Load DATA LOCAL INFILE 'C:/Users/Robert/Desktop/test.csv' INTO TABLE Test FIELDS TERMINATED BY ',' ENCLOSED BY '""' ESCAPED BY '' LINES TERMINATED BY '\r\n' IGNORE 0 LINES;"
Dim myCUpload As New MySqlCommand(uploadQry, exclecon)
exclecon.Open()
myCUpload.ExecuteNonQuery()
End Using