如何在两个aspx页面调用之间保持一个连接 [英] how to keep one connection between two aspx page calls

查看:54
本文介绍了如何在两个aspx页面调用之间保持一个连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有asp.net程序。我使用一种非常简单的数据传输方法,使用

URL


?°First.aspx?±内容一行将数据发送到?°秒。 aspx?±page,for

例如: http: //server/path/seond.apsx?data=mydata

客户设置刷新率在?°First.aspx?页面。


因此,如果客户将刷新率设置为6秒(mydata可能每个不同的时间为
),则有超过10个不同的呼叫(连接)到

?°second.aspx?±来自同一个?°first.aspx?±页面在一分钟内。这给了

我错误403.9。 (连接太多)


无论如何我可以在两页之间一直保持一个连接吗?


谢谢

Hi

I have asp.net programs. I used a very simple data transfer method by using
URLs

?°First.aspx?± contents a line to send data to the ?°second.aspx?± page, for
example: http://server/path/seond.apsx?data=mydata

There is a customer setting refresh rate in ?°First.aspx?± page.

So, if customer set refresh rate to 6 sec (mydata could be different each
time), there are more then 10 different calls (connections) to
?°second.aspx?± from the same ?°first.aspx?± page in one minute. This gave
me Error 403.9. (too many connections)

Is anyway I can keep the one connetions all the time between the two pages?

thanks

推荐答案

Hello Larry:


使用.NET中的连接池,您不需要共享连接
网页之间的
对象(虽然你可以在技术上将它存储在会话中

对象)。如果您在完成检索数据后明确关闭了连接,那么它可能会更好。


您可以进一步了解MSDN上的连接池:
http://msdn.microsoft.com/library/de...taProvider.asp

HTH,

Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" Larry"写道:
Hello Larry:

With connection pooling in .NET you do not need to share the connection
object between web pages (though you can technically store it in the session
object). It might work better if you explicitly closed the connection after
you finished retrieving the data.

You can further read about the connection pooling on MSDN:
http://msdn.microsoft.com/library/de...taProvider.asp

HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Larry" wrote:


我有asp.net程序。我使用了一种非常简单的数据传输方法,使用

???°First.aspx ???±内容一行将数据发送到???°second.aspx? ??±page,用于
示例: http:// server / path / seond.apsx?data = mydata

客户设置刷新率在???°First.aspx ???页面。

因此,如果客户将刷新率设置为6秒(mydata每个
时间可能不同),则有超过10个不同的调用(连接)来自
??? second.aspx ???一分钟内???°first.aspx ???±页面。这给了我错误403.9。 (连接太多了)

无论如何,我可以在两页之间一直保持一个连接吗?

感谢
Hi

I have asp.net programs. I used a very simple data transfer method by using
URLs

???°First.aspx???± contents a line to send data to the ???°second.aspx???± page, for
example: http://server/path/seond.apsx?data=mydata

There is a customer setting refresh rate in ???°First.aspx???± page.

So, if customer set refresh rate to 6 sec (mydata could be different each
time), there are more then 10 different calls (connections) to
???°second.aspx???± from the same ???°first.aspx???± page in one minute. This gave
me Error 403.9. (too many connections)

Is anyway I can keep the one connetions all the time between the two pages?

thanks



如果我使用连接生命周期,它会没问题。在我的连接字符串中?


" Server = mypc; Database = mydata; User ID = sa; Password = ps; Trusted_Connection = True;

连接生命周期= 5


在6秒后断开它。

感谢

" Phillip Williams" <博士************** @ webswapp.com>在消息中写道

新闻:3D ********************************** @ microsof t.com ...
will it be ok if I use the "connection lifetime" in my connection string?

"Server=mypc;Database=mydata;User ID=sa;Password=ps;Trusted_Connection=True;
Connection Lifetime=5"

disconnect it after 6 sec.
thanks
"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:3D**********************************@microsof t.com...
Hello Larry:

使用.NET中的连接池,您不需要在网页之间共享连接对象(尽管你可以在技术上将其存储在
会话对象中)。如果在完成检索数据后明确关闭连接
,它可能会更好。

您可以进一步了解MSDN上的连接池:
http://msdn.microsoft.com/library /de...us/cpguide/htm

l / cpconConnectionPoolingForSQLServerNETDataProvider。 asp
HTH,
Phillip Williams
http://www.societopia .net
http://www.webswapp.com

" Larry"写道:
Hello Larry:

With connection pooling in .NET you do not need to share the connection
object between web pages (though you can technically store it in the session object). It might work better if you explicitly closed the connection after you finished retrieving the data.

You can further read about the connection pooling on MSDN:
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconConnectionPoolingForSQLServerNETDataProvider. asp
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Larry" wrote:


我有asp.net程序。我使用了一个非常简单的数据传输方法
使用URL

??? First.aspx ??à内容一行将数据发送到??? second.aspx ??à
页面,例如: http:// server / path / seond。 apsx?data = mydata

在??? First.aspx ??à页面中有一个客户设置刷新率。

所以,如果客户设置刷新速率为6秒(mydata每次可能不同
),有超过10个不同的呼叫(连接)来自同一个??? first.aspx的第二个.aspx ??à ??一分钟内的页面。
这给了我错误403.9。 (连接太多)

无论如何,我可以在两个
页面之间一直保持一个连接?

感谢
Hi

I have asp.net programs. I used a very simple data transfer method by using URLs

???First.aspx??à contents a line to send data to the ???second.aspx??à page, for example: http://server/path/seond.apsx?data=mydata

There is a customer setting refresh rate in ???First.aspx??à page.

So, if customer set refresh rate to 6 sec (mydata could be different each time), there are more then 10 different calls (connections) to
???second.aspx??à from the same ???first.aspx??à page in one minute. This gave me Error 403.9. (too many connections)

Is anyway I can keep the one connetions all the time between the two pages?
thanks



Hello Larry,

如果找到
,你当然可以尝试连接生命周期值。
它有所作为。但是,你仍然得到太多

连接如果你在每个页面中完成数据检索后直接关闭连接对象会出错吗?

-

Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" Larry"写道:
Hello Larry,

You can certainly experiment with the Connection Lifetime values if you find
that it makes a difference. But, are you still getting the "too many
connections" error if you close the connection object directly after the
retrieval of the data is done in every page?
--
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Larry" wrote:
如果我使用连接生命周期,它会没问题吗?在我的连接字符串中?

" Server = mypc; Database = mydata; User ID = sa; Password = ps; Trusted_Connection = True;
Connection Lifetime = 5"
< 6秒后断开它。
谢谢

" Phillip Williams" <博士************** @ webswapp.com>在消息中写道
新闻:3D ********************************** @ microsof t.com。 ..
will it be ok if I use the "connection lifetime" in my connection string?

"Server=mypc;Database=mydata;User ID=sa;Password=ps;Trusted_Connection=True;
Connection Lifetime=5"

disconnect it after 6 sec.
thanks
"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:3D**********************************@microsof t.com...
Hello Larry:

使用.NET中的连接池,您不需要在网页之间共享连接对象(尽管您可以在技术上存储它)在
Hello Larry:

With connection pooling in .NET you do not need to share the connection
object between web pages (though you can technically store it in the


session


session

object中。如果在
object). It might work better if you explicitly closed the connection
完成检索数据后明确关闭连接


after


,它可能会更好。

您可以进一步阅读有关连接池的信息。 MSDN:

you finished retrieving the data.

You can further read about the connection pooling on MSDN:


http://msdn.microsoft.com/library/de...us/cpguide/htm
l / cpconConnectionPoolingForSQLServerNETDataProvider。 asp


http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconConnectionPoolingForSQLServerNETDataProvider. asp


HTH,
Phillip Williams
http://www.societopia.net
http:// www。 webswapp.com

" Larry"写道:

HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Larry" wrote:


我有asp.net程序。我使用了一种非常简单的数据传输方法,使用URL

????£First.aspx ?????内容一行将数据发送到????£second.aspx ?????页面,例如: http://server/path/seond.apsx?data = mydata

客户设置刷新率在????£First.aspx ?????因此,如果客户将刷新率设置为6秒(每次mydata可能不同),则有超过10个不同的呼叫(连接)到第二个。 .ASPX ?????来自同一个????£first.aspx ?????一分钟内的页面。这给了我错误403.9。 (连接太多)

无论如何,我可以在两页之间一直保持一个连接吗?

谢谢
Hi

I have asp.net programs. I used a very simple data transfer method by using URLs

????£First.aspx????? contents a line to send data to the ????£second.aspx????? page, for example: http://server/path/seond.apsx?data=mydata

There is a customer setting refresh rate in ????£First.aspx????? page.

So, if customer set refresh rate to 6 sec (mydata could be different each time), there are more then 10 different calls (connections) to
????£second.aspx????? from the same ????£first.aspx????? page in one minute. This gave me Error 403.9. (too many connections)

Is anyway I can keep the one connetions all the time between the two pages?
thanks




这篇关于如何在两个aspx页面调用之间保持一个连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆