问题描述
SqlCommand delcmd = new SqlCommand();
           delcmd.CommandText =" DELETE FROM add_investor WHERE investor_cnic =" + dataGridView1.SelectedRows [0] .Cells [0] .Value.ToString()
+"" ;;
                 my.Open();&
      delcmd.Connection = my;
      delcmd.ExecuteNonQuery();
      my.Close();
      dataGridView1.Rows.RemoveAt(dataGridView1.SelectedRows [0] .Index);
           my.Close();
SqlCommand delcmd = new SqlCommand();
delcmd.CommandText = "DELETE FROM add_investor WHERE investor_cnic=" + dataGridView1.SelectedRows[0].Cells[0].Value.ToString() + "";
my.Open();
delcmd.Connection = my;
delcmd.ExecuteNonQuery();
my.Close();
dataGridView1.Rows.RemoveAt(dataGridView1.SelectedRows[0].Index);
my.Close();
将nvarchar值'34101-1212121-1'转换为数据类型int时转换失败。
Conversion failed when converting the nvarchar value '34101-1212121-1' to data type int.
什么是错的
推荐答案
这篇关于转换失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!