5
Answers

convertion failed

ta mu

ta mu

11y
1.3k
1
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)