Closed GoogleCodeExporter closed 8 years ago
Confirms it, It was giving error since, I used return type as Object for this
timestamp timestamp fields, When Byte[] is used it worked again, seems you can
not pass object type to your stored procedure otherwise your dapper will be
blow up with error.
Original comment by bijaykap...@gmail.com
on 22 Nov 2012 at 4:27
[deleted comment]
Can you show a *complete* (i.e. including the calling code) example that fails?
The following works fine:
connection.Execute("create table #issue123 (id int not null identity(1,1), val int not null, ts timestamp not null)");
var row = connection.Query("insert #issue123 (val) output INSERTED.id, INSERTED.ts values (@val)", new { val = 123 }).Single();
byte[] ts = row.ts;
int id = row.id;
int count = connection.Query<int>("update #issue123 set val = @val where id = @id and ts = @ts select @@rowcount", new { val = 456, id, ts }).Single();
count.IsEqualTo(1);
int val = connection.Query<int>("select val from #issue123 where id = @id", new { id }).Single();
val.IsEqualTo(456);
Alternatively, can you please give an indication of what type of value you are
supplying into @TimeStamp.
Original comment by marc.gravell
on 22 Nov 2012 at 7:47
In particular, the dapper code **does not include** any reference to
SqlDateTime, so dapper isn't doing a conversion to that. And SqlDateTime is
**not** an appropriate date type for a timestamp. A timestamp *is not a time* -
it is a blob.
Additional: for that reason (confusion), the keyword "timestamp" is formally
marked obsolete in MSDN; you should use "rowversion", which is identical, but
less confusing (it doesn't make people think "time")
Original comment by marc.gravell
on 22 Nov 2012 at 7:50
No further example provided; closing
Original comment by marc.gravell
on 6 Aug 2014 at 3:33
Original issue reported on code.google.com by
bijaykap...@gmail.com
on 22 Nov 2012 at 3:54