0
DbCommand retcommmand;



var attachmentDetails = this.ConvertToDatatable<CurfewAttachmentDetails>(curfewRequestForSave.Attachment);
            List<CommandParameter> SqlparamUpdate = new List<CommandParameter>();
            // SqlparamUpdate.Add(new CommandParameter("@PI_CurfewRelaxationId", curfewRequestForSave.CurfewRelaxationId, ParameterDirection.Input, DbType.Int64));
            SqlparamUpdate.Add(new CommandParameter("@PI_CurfewRelaxationId", curfewRequestForSave.CurfewRelaxationId, ParameterDirection.Input, DbType.Int64));
            SqlparamUpdate.Add(new CommandParameter("@PI_CurfewRelaxationRequestId", "TODO Code For WorkFlow", ParameterDirection.Input, DbType.String));
            SqlparamUpdate.Add(new CommandParameter("@PI_CurfewRequestCode", String.Empty, ParameterDirection.Input, DbType.String));
            SqlparamUpdate.Add(new CommandParameter("@PI_StaffSeqId", curfewRequestForSave.StaffSeqId, ParameterDirection.Input, DbType.Int64));
            SqlparamUpdate.Add(new CommandParameter("@PI_RequestCategoryId", curfewRequestForSave.RequestCategoryId, ParameterDirection.Input, DbType.Int32));
            SqlparamUpdate.Add(new CommandParameter("@PI_RequestTypeId", curfewRequestForSave.RequestTypeId, ParameterDirection.Input, DbType.Int32));
            SqlparamUpdate.Add(new CommandParameter("@PI_Reason", curfewRequestForSave.Reason, ParameterDirection.Input, DbType.String));
            SqlparamUpdate.Add(new CommandParameter("@PI_PermissionRequiredFrom", curfewRequestForSave.PermissionRequiredFrom, ParameterDirection.Input, DbType.DateTime));
            SqlparamUpdate.Add(new CommandParameter("@PI_PermissionRequiredTill", curfewRequestForSave.PermissionRequiredTill, ParameterDirection.Input, DbType.DateTime));
            SqlparamUpdate.Add(new CommandParameter("@PI_RelationshipId", curfewRequestForSave.RelationshipId, ParameterDirection.Input, DbType.Int32));
            SqlparamUpdate.Add(new CommandParameter("@PI_Spouse_Blood_Name", curfewRequestForSave.Spouse_Blood_Name, ParameterDirection.Input, DbType.String));
            SqlparamUpdate.Add(new CommandParameter("@PI_ReturnDate", curfewRequestForSave.ReturnDate, ParameterDirection.Input, DbType.DateTime));
            SqlparamUpdate.Add(new CommandParameter("@PI_ShiftTimmingsFrom", curfewRequestForSave.ShiftTimmingsFrom, ParameterDirection.Input, DbType.DateTime));
            SqlparamUpdate.Add(new CommandParameter("@PI_ShiftTimmingsTo", curfewRequestForSave.ShiftTimmingsTo, ParameterDirection.Input, DbType.DateTime));
            SqlparamUpdate.Add(new CommandParameter("@PI_CreatedBy", curfewRequestForSave.StaffSeqId, ParameterDirection.Input, DbType.Int64));
            SqlparamUpdate.Add(new CommandParameter("@PI_UpdatedBy", curfewRequestForSave.StaffSeqId, ParameterDirection.Input, DbType.Int64));
            SqlparamUpdate.Add(new CommandParameter("@PI_CurfewRquestAttchMntDetails", attachmentDetails, ParameterDirection.Input,SqlDbType.Structured));
            SqlparamUpdate.Add(new CommandParameter("@PO_MESSAGE", "", ParameterDirection.Output, DbType.String, 500));
            SqlparamUpdate.Add(new CommandParameter("@PO_RETURN_CODE", 0, ParameterDirection.Output, DbType.Int32));

            retcommmand = _sqldbframework.ExecuteSPNonQueryParm("QAG_GEMS_CURFEW_REQUEST_SAVE_DETAILS_PROC", SqlparamUpdate);

我应该使用CommandParameter其他团队定义的方法插入到数据库中,SQLCommandParameter在这种情况下我无法更改为如何传递表值参数

我得到这个

错误无法从 System.Data.SqlDbType 转换为 System.Data.DbType

4

0 回答 0