代码如下:StreamReader sr = new StreamReader(“E:\\123.txt”);//文件路径 string oneLine; while ((oneLine = sr.ReadLine()) != null) { string[] str = oneLine.Split(‘|’); string sql = “insert into TableDX(number,name,produce,xinghao) values(‘” + str[0].ToString() + “‘,'” + str[1].ToString().Replace(“‘”,”‘”) + “‘,