CREATE PROCEDURE [test].[proc]
@ConfiguredContentId int,
@NumberOfGames int
AS
BEGIN
SET NOCOUNT ON
RETURN
@WunNumbers TABLE (WinNumb int)
INSERT INTO @WunNumbers (WinNumb)
SELECT TOP (@NumberOfGames) WinningNumber
FROM [Game].[Game] g
JOIN [Game].[RouletteResult] AS rr ON g.[Id] = rr.[gameId]
WHERE g.[ConfiguredContentId] = @ConfiguredContentId
ORDER BY g.[Stoptime] DESC
SELECT WinNumb, COUNT (WinNumb) AS "Count"
FROM @WunNumbers wn
GROUP BY wn.[WinNumb]
END
GO
Run Code Online (Sandbox Code Playgroud)
此存储过程从第一个select语句返回值,但我希望返回第二个select语句中的值.表@WunNumbers是一个临时表.
有任何想法吗???
我正在ASP.NET MVC 2中开发一个网站.在某些时候,我在控制器中找到一个ActionResult,我显然是在调用方法
return View();
Run Code Online (Sandbox Code Playgroud)
有什么办法,我可以将QueryString传递给我的视图或将参数附加到URL?
我有一个ASP.MVC 2网页,我的身份验证完成如下:
FormsAuthentication.SetAuthCookie(user.UserName, false);
FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, "fooPage" + user.UserName, DateTime.Now, DateTime.Now.AddMinutes(10), false, String.Empty);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket));
Response.Cookies.Add(cookie);
Run Code Online (Sandbox Code Playgroud)
现在我想设置我的web.config,只有在用户通过身份验证时才能访问少量页面.我的web.config设置如下:
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogIn" timeout="2880"/> //all users can access my web site
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path="~/Views/Sales/Index.aspx">
<system.web>
<authorization>
<deny users="?"/> //only authenticated users can access this page
</authorization>
</system.web>
</location>
</configuration>
Run Code Online (Sandbox Code Playgroud)
...但是这并不正常工作.
我究竟做错了什么?