c# - 收到“输入字符串格式不正确”错误
问题描述
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
c2.command("insert into facture_haraki values("'
+ dataGridView1.Rows[i].Cells[1].Value.ToString() + "','"
+ dataGridView1.Rows[i].Cells[5].Value.ToString() + "',"
+ Convert.ToDouble(dataGridView1.Rows[i].Cells[6].Value.ToString() + ",'"
+ dataGridView1.Rows[i].Cells[4].Value.ToString()) + "',"
+ Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value.ToString()) + ","
+ Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value.ToString()) + ","
+ Convert.ToDouble(dataGridView1.Rows[i].Cells[7].Value.ToString()) + ","
+ (lasttotal * 1500) + ","
+ lasttotal + ","
+ discount + ",'"
+ dataGridView1.Rows[i].Cells[0].Value.ToString() + "',"
+ width + ",'"
+ notes +
"')");
}
解决方案
就像 emangusta 提到的那样,您有一个语法错误,导致语句被错误地解析。
推荐阅读
- android - 导航组件参数默认值
- mysql - 我们如何在mysql中实现tis结果?
- emacs - 尝试运行后台进程时暂停 tty 输出
- swift - SwiftUI 可观察对象未观察到
- swift - 在 Swift 中显示数组的非重复元素
- python - 实例化类并通过与类声明相同的模块中的函数调用其函数?
- sql - 错误:由于并发更新,无法序列化访问
- php - 如何在laravel中获取数组的某些元素?
- azure - 错误代码:从 Azure 流分析作业中采样数据时出现 BadArgument 错误消息
- database - Adonis.js give an error when try to run adonis serve --dev command