ExecuteSqlCommand with output parameter

前端 未结 6 1015
名媛妹妹
名媛妹妹 2020-12-06 04:43

I\'m using Entity Framework in an ASP.NET MVC3 application and I\'m trying to use the following code:

var token = \"\";
this.Database.ExecuteSqlCommand(\"exe         


        
6条回答
  •  死守一世寂寞
    2020-12-06 05:15

    You need to indicate the direction in the parameter. For example, try something like this:

    var p = new SqlParameter("token", token);
    p.Direction = ParameterDirection.InputOutput;
    this.Database.ExecuteSqlCommand("exec dbo.MyUsp", p);
    

提交回复
热议问题