ParameterDirection.ReturnValue到底返回的是什么值?
moneyboy (
烈焰燃冰)
2005-04-07 18:11:58 在
实验:
存储过程如下:
ALTER procedure mysp_get
as
set nocount on
select count(*) from Employees
set nocount off
代码:
cmd=new SqlCommand("mysp_get",conn);
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameters.Add(
new SqlParameter("ReturnValue", SqlDbType.Int, 4,
ParameterDirection.ReturnValue, false, 0, 0,
string.Empty, DataRowVersion.Default, null));
Response.Write((cmd.ExecuteNonQuery()).ToString());
conn.Close();
结果为-1
到底ParameterDirection.ReturnValue返回的是什么值啊?
从MSDN里查的那句话就不用贴上来了
问题点数:
50、回复次数:
9
.NET技术 /
ASP.NET 提问
4楼
xxuu503 (
学会糜烂和挥霍,恐惧不安和堕落!)
回复于
2005-04-07 18:29:50 得分
15
存储过程没有output方向参数!
sql执行失败exenoquery返回-1!
6楼
moneyboy (
烈焰燃冰)
回复于
2005-04-07 18:37:46 得分
0
实验二:
将存储过程改为
ALTER procedure mysp_get
@ss int out
as
set nocount on
select @ss=count(*) from Employees
set nocount off
返回值依然是-1
7楼
moneyboy (
烈焰燃冰)
回复于
2005-04-07 18:40:49 得分
0
实验三:
将存储过程改为
ALTER procedure mysp_get
as
set nocount on
return 1
set nocount off
返回-1
汗 ̄ ̄到底ParameterDirection.ReturnValue返回的是什么值???
8楼
ying8959 (
阿因)
回复于
2005-04-07 18:45:52 得分
0
前一段我用APS.NET作了一个基于拉技术的聊天室,后来想在其中增加点游戏内容,感觉到基于拉技术的响应实时性不好,所以想改为基于拉技术的。
现已作了尝试,代码如下:
// Content.aspx.cs ///
public class Content : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Session.Timeout = 60;
Response.Write("欢迎 . . .<br>/n");
Response.Flush();
Application[Session.SessionID] = Response;
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
}
}
// Send.aspx.cs //
public class Send : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button ButtonSend;
protected System.Web.UI.WebControls.TextBox TextBox1;
private void ButtonSend_Click(object sender, System.EventArgs e)
{
foreach(string name in Application.AllKeys)
{
HttpResponse Response = Application[name] as HttpResponse;
if(Response!=null && Response.IsClientConnected)
{
Response.Write(TextBox1.Text + "<br>/n");
Response.Flush();
}
else
{
Application.Remove(name);
}
}
}
}
可以聊天,但发现一大问题:同时连接的用户被限制在50个左右,再多的就连不上了,并且会导致其他用户也陷于停滞状态。
请高手答疑解惑,还可另开贴给分!