C# 中带参数的insert语句当插入image类型为空值时报错
strSQL="Insert Hr_BaseInfo(FEmpID,FEmpNo,FEmpName) values (1,'001','张三',@Image_byte) " string CnnStr = ClsDataOperer.GetString(); SqlConnection sqlConn = new SqlConnection(CnnStr); sqlConn.Open(); //创建SqlCommand对象 SqlCommand command = new SqlCommand(strSQL, sqlConn); //调用文件流方法 command.Parameters.Add("@Image_byte", SqlDbType.Image).Value = Image_byte; //执行添加 int i = command.ExecuteNonQuery();