我有一个总是返回"PRINT"命令的SQL过程,我想提取这个"PRINT"命令的输出,即C#中的过程我该怎么做?这是程序
ALTER PROC ResultsPoll
@pollid INT
AS
DECLARE @count1 INT
DECLARE @count2 INT
DECLARE @count3 INT
DECLARE @count4 INT
DECLARE @count5 INT
DECLARE @test VARCHAR(MAX)
DECLARE @value VARCHAR(MAX)
SELECT @count1 = COUNT(mem_id) FROM Students_answer_Polls INNER JOIN Polls ON Polls.poll_id = Students_answer_Polls.poll_id
WHERE Students_answer_Polls.poll_id = @pollid AND Students_answer_Polls.answer = Polls.a1
SELECT @count2 = COUNT(mem_id) FROM Students_answer_Polls INNER JOIN Polls ON Polls.poll_id = Students_answer_Polls.poll_id
WHERE Students_answer_Polls.poll_id = @pollid AND Students_answer_Polls.answer = Polls.a2
SELECT @count3 = COUNT(mem_id) FROM Students_answer_Polls INNER JOIN Polls ON …Run Code Online (Sandbox Code Playgroud) 下面的代码编译得很好,但是当我尝试输入helper 10 primes [] []时,它给了我:函数助手中的非详尽模式
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, …Run Code Online (Sandbox Code Playgroud) 我在MACOSX上使用续集专业版,我已经定义了包含外键的表,它仍然给我这个错误无法创建表(错误号:150)
CREATE TABLE members (
mem_id INTEGER,
f_name VARCHAR(10),
l_name VARCHAR(10),
address VARCHAR(40),
name VARCHAR(20),
domain VARCHAR(15),
PRIMARY KEY(mem_id)
)
CREATE TABLE member_phone (
mem_id INTEGER,
phone_no INTEGER,
PRIMARY KEY (mem_id,phone_no),
FOREIGN KEY (mem_id) REFERENCES members
)
Run Code Online (Sandbox Code Playgroud) 我已成功设置应用程序将我发送到 url 之类的
http://localhost:8000/log_in/?next=/task/1/
Run Code Online (Sandbox Code Playgroud)
我已将上下文处理器定义如下
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"django.core.context_processors.request",
)
Run Code Online (Sandbox Code Playgroud)
但是当我登录时,它将我重定向到主页,我request在我的登录视图中打印了它,我得到了GET一个空查询集,它是搁浅的,任何想法为什么!?
我也尝试添加
<input type="hidden" name="next" value="{{next}}" />
Run Code Online (Sandbox Code Playgroud)
到 login.html,但这将POST请求的 next 添加为空参数
编辑 1
登录视图,我尝试打印 'next' 参数并返回 null,因为它GET是一个空的查询集
def log_in(request):
"""
This method checks for the input username(email) and password.
If they are empty the user id redirected to the login page, else checks whether
the user is authenticated. If the user is not found in …Run Code Online (Sandbox Code Playgroud)