Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1273

Remove unnecessary cast to (int) in Spring.Data.Core.AdoTemplate ExecuteScalar with ICommandSetter method argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0 RC1
    • Fix Version/s: 1.3.0
    • Component/s: Spring-NET-DA
    • Labels:
      None

      Description

      AdoTemplate, ExecuteScalar Method (Line 525) will cast the result to an int where it should not. Executing queries which return other types than integers will result in a InvalidCastException. Removing the explicit int cast will solve this issue.

      public object ExecuteScalar(CommandType cmdType, string cmdText,
      ICommandSetter commandSetter)

      { return (int)Execute(new ExecuteScalarCallbackWithCommandSetter(cmdType, cmdText, commandSetter)); }

        Attachments

          Activity

            People

            Assignee:
            mark.pollack Mark Pollack
            Reporter:
            paul.rogalinski@skytecag.com Paul Rogalinski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified