“SqlParameterCollection only accepts non-null SqlParameter type objects, not String objects”

后端 未结 8 1922
暗喜
暗喜 2021-01-04 07:23

I keep getting the exception

The SqlParameterCollection only accepts non-null SqlParameter type objects, not String objects

, while execut

8条回答
  •  借酒劲吻你
    2021-01-04 08:01

    Try below

    comm.Parameters.Add("@author", SqlDbType.VarChar);
    comm.Parameters["@author"].Value = dataGridView1.Rows[i].Cells[0].Value.ToString();
    

提交回复
热议问题