C#运行发生错误,该怎么改?

img

会发生错误

img

以下就是代码了:

        //判断是否选中行
        if(dataGridView1.SelectedRows.Count>0)
        {

        }
        else
        {
            MessageBox.Show("请选择要删除的行");
            return;
         }
        //获取输入的信息
        string id = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
        
        //删除操作
        string strsql = "selete from kqlog where id='" + id + "'";
        // 添加异常处理
        try
        {
            SqlConnection con = GetCon();
            con.Open();
            SqlCommand cmd = con.CreateCommand();
            cmd.CommandText = strsql;
            int count = cmd.ExecuteNonQuery();
            if (count > 0)
            {
                this.toolStripStatusLabel1.Text = "操作成功 !";
            }
            con.Close();
            shuxin();
        }
        catch (Exception ex)
        {

            this.toolStripStatusLabel1.Text = "操作失败!失败原因:" + ex.Message;

        }

img


select语句没有列要求 *号也得有吧

有了*号也会出错

img