Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of enums in Table valued parameters #91

Open
leevva opened this issue Dec 15, 2016 · 1 comment
Open

Support of enums in Table valued parameters #91

leevva opened this issue Dec 15, 2016 · 1 comment

Comments

@leevva
Copy link

leevva commented Dec 15, 2016

It seems that it doesn't work when TVP class contains enum.
I get exception:

Result Message: System.InvalidCastException : Specified cast is not valid.

Result StackTrace:
at Microsoft.SqlServer.Server.SqlDataRecord.SetValue(Int32 ordinal, Object value)
at CodeOnlyStoredProcedure.TableValuedParameter.CrateValuedParameter(IEnumerable table, Type enumeratedType)
at CodeOnlyStoredProcedure.TableValuedParameter.CreateDbDataParameter(IDbCommand command)
at CodeOnlyStoredProcedure.StoredProcedure.AddParameters(IDbCommand cmd)
at CodeOnlyStoredProcedure.StoredProcedure3.Execute(IDbConnection connection, CancellationToken token, Int32 timeout) at CodeOnlyStoredProcedure.StoredProcedure3.Execute(IDbConnection connection, Int32 timeout)

@abe545
Copy link
Owner

abe545 commented Dec 15, 2016

Hmmm, I could have sworn I've tried that before. Could you provide the signature of the TVP in SQL server, as well as the class you're using to pass it?

Edit: No, you're right: I've tracked this in #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants