ta mu

ta mu

  • NA
  • 201
  • 82.2k

convertion failed

Dec 16 2013 1:47 AM
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();

Conversion failed when converting the nvarchar value '34101-1212121-1' to data type int.

whats wrong


Answers (5)