上载CSV文件时使用MySQL在C#中连接过多
我想知道当我试图将CSV文件中的数据插入MYSQL数据库时,如何解决这种错误。下面是我的代码:上载CSV文件时使用MySQL在C#中连接过多,c#,mysql,csv,C#,Mysql,Csv,我想知道当我试图将CSV文件中的数据插入MYSQL数据库时,如何解决这种错误。下面是我的代码: while (null != (sLine = __reader.ReadLine())) { while (rexRunOnLine.IsMatch(sLine) && null != (sNextLine = __reader.ReadLine())) { sLine += "\n" + sNextLine; __rowno++;
while (null != (sLine = __reader.ReadLine()))
{
while (rexRunOnLine.IsMatch(sLine) && null != (sNextLine = __reader.ReadLine()))
{
sLine += "\n" + sNextLine;
__rowno++;
string[] values = rexCsvSplitter.Split(sLine);
billOfMaterials.Allotment_code = values[0];
billOfMaterials.category_name = values[1];
billOfMaterials.activity = values[2];
billOfMaterials.quantity = values[3];
billOfMaterials.end_unit_quantity = values[4];
billOfMaterials.unit = values[5];
billOfMaterials.description = values[6];
billOfMaterials.unit_cost = values[7];
billOfMaterials.regular_labor_cost = values[8];
billOfMaterials.end_unit_labor_cost = values[9];
billOfMaterials.type = values[10];
billOfMaterials.batch = int.Parse(values[11]);
billOfMaterials.AddBillOfMaterials();
yield return values;
}
__reader.Close();
}
以下是我遇到的错误:
啊,老谷歌我的朋友:@FrankerZ谢谢你的快速回复。可以将我的最大连接更改为任何值吗?啊,老谷歌我的朋友:@FrankerZ感谢您的快速响应。可以将我的最大连接更改为任何值吗?