Created
February 20, 2012 17:30
-
-
Save taylonr/1870209 to your computer and use it in GitHub Desktop.
PetaPoco Stored Procedure Return Value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sql = new Sql().Append("declare @@result int") | |
.Append("exec GetData @userId, @date", | |
new {userId = userId, @date = DateTime.Now}) | |
.Append("select @@result); | |
var ret = Database.ExecuteScalar<int>(sql); |
var sql = new Sql().Append("declare @@result int")
.Append("exec @@result = GetData @userId, @date",
new {userId = userId, @date = DateTime.Now})
.Append("select @@result");
var ret = Database.ExecuteScalar<int>(sql);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When i try this i am getting null......Need help pls