Delete a record in DataGridView

2019-09-06 20:22发布

问题:

I'm trying to delete a record in DataGridView but it is giving me this error:

Must declare the scalar variable "@reg_id".

My reg_id is the primary key column in the table. How can I resolve this?

回答1:

You have to give default value to @reg_id in stored procedure where you declare this parameter.

like @reg_id = NULL or @reg_id = ' '