Last post May 04, 2016 02:50 AM by Angie xu - MSFT
Apr 21, 2016 03:34 PM|kangarolf|LINK
I think the default is nvarchar but this is making my HASHBYTES check on a password fail.
Is there a way to set the parameter type when you add it to a query command?
db.QuerySingle(mySQL, parameter1, makemevarcharNOTnvarchar);
Apr 22, 2016 06:16 AM|Mikesdotnetting|LINK
Internally, the Database methods use the AddWithValue method of the DbParameterCollection class, which takes the parameter name and an object representing the value. It doesn't provide a way for you to specify the parameter type. You can either implement
your own extension method on the Database class, or revert to plain ADO.NET to execute your command.
Apr 22, 2016 06:28 AM|kangarolf|LINK
May 04, 2016 02:50 AM|Angie xu - MSFT|LINK
Think I'll have a go at extending the class, haven't tried that yet. Any good tutorials around that you know of? I'm googling already of course.
SqlParameterCollection.AddWithValue adds a value to the end of the
This is the reference:
Have a good day.