Search

SqlParameter constructor does not accept enum:byte values by BetterToday

Active

1
0
Sign in
to vote
Type: Bug
ID: 771647
Opened: 11/19/2012 1:29:36 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
The SqlParameter(string parameterName, object value) constructor does not correctly read values coming from a byte based enumeration. It always sets null to the SqlValue property.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

.NET Framework 4.5

Steps to reproduce

(1) Create a byte based enumeration:

public enum : byte {Value1, Value2}

(2) Create a SqlParameter object by using the SqlParameter(string parameterName, object value) constructor

Product Language

German

Operating System

Windows Server 2008 R2

Operating System Language

German

Actual results

While DbType and SqlDbType properties are correctly set to Byte, the SqlValue property is not set properly. It stays the default value (null).

Expected results

The SqlValue property should be set to the corresponding Byte value.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/27/2012 at 11:06 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/20/2012 at 12:13 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting a demo project. Please submit this information to us within 3 business days. We look forward to hearing from you with this information.
Posted by Microsoft on 11/19/2012 at 1:52 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.