venky 解决方案 >首先,它是一个很好的方法吗? 我们可以在那里停下来,因为不,这不是一个好方法。它听起来像是来自ASP背景,其中连接池 不是平台的一部分。使用ASP.Net,最好打开并尽快关闭你的Connections,然后将它们释放回 池。 - HTH, Kevin Spencer ..Net开发人员 Microsoft MVP 大件东西组成 很多小东西。 Venkat Chellam <已经************ @ yahoo.com>在消息中写道 news:ac ************************** @ posting.google.c om ... 我有一个特殊的问题。我有一个简单的Web应用程序,它从oracle表中加载一些数据并显示在网页的datagrid中,datagrid已启用页面,在页面上显示10行。我有一个根据数据范围搜索记录的搜索条件我将给出 这就是我在!IsPostBack部分所做的工作。我正在设置oracle连接,创建数据集对象,datadapter以及我将数据从数据库加载到数据集中,并将所有数据集,数据适配器和连接对象移动到会话对象。现在用户可以对记录进行不同的操作,比如他从网格中选择一行,然后在网格的列中有按钮进行更新,所以我做了什么,更新数据集对象对于那个特定的行,然后当下一个时间页面加载被调用时,我调用dataadapter.update来将数据更新回数据库。所以我的dataproviders对象存储在会话对象中。首先,它是一个很好的方法吗? 第二次会话结束,如果用户回来并做了一些操作,它会因为会话而无法更新变量被破坏,它会产生错误。我该怎么做才能解决这个问题?或者,如果会话对象不是存储此 dataprovider对象的好地方,那么我应该存储哪些?我的页面没有用户登录,我只是使用asp.net创建的默认会话。请帮助我,非常紧急 venky 感谢您的回复。你能更多地阐述我想做的事情吗?我 也没用过asp,这是我第一次使用 一些webapplication。 你能告诉我吗?我更详细的我想做什么或一些样品 代码? venky ***通过Developersdex发送 http://www.developersdex.com *** 不要只是参加USENET ......获得奖励! 精心制作?好吧,当你想使用你的数据库时,打开一个 连接,做你的工作,然后立即关闭它。 你可能想创建一个每当您需要连接到数据库时,您可以使用的静态数据库实用程序函数类。我相信微软 可以提供其中一些,虽然我不知道在哪里(我自己写的)。 希望这里的其他人可以告诉你。 - HTH, Kevin Spencer ..Net开发人员 微软MVP 大件东西组成 很多小东西。 " venkat chellam" <已经************ @ yahoo.com>在消息中写道 news:uv ************** @ TK2MSFTNGP10.phx.gbl ... 一些webapplication。 你能告诉我更多我想做的事情或者一些事情吗?样品代码? venky ***通过Developersdex发送 http://www.developersdex.com *** 不要只是参加USENET ......获得奖励! I have a peculiar problem. I have a simple web application which loadssome data from the oracle table and display in the datagrid in thewebpage and datagrid has page enabled which shows 10 rows at a page.Ihave a search criteria to search the records based on the data range igiveThis is what i have done, in the !IsPostBack section. I am setting upthe oracle connection, creating dataset object, datadapter and i asloload the data from the database into dataset and move all dataset,datadapter, and connection object to session object. Now user can dodifferent operations withe records, like he select a row from grid andthere is button on in column of the grid to update , so what i do ,update the dataset object for that particular row and then when nexttime page load is called, i call dataadapter.update to update the databack to the database. so my dataproviders objects are stored in thesession object. First of all is it a good way to do this?Second when the session ends, and if the user comes back and does someoperation, it going to fail to update because the session variablesare destroyed and it will generate an error. What should i do to solvethis problem? Or if session object is not a good place to store thisdataprovider object, where shoould i store?. My page doesn''t have auser login, i am just using the default session created by asp.net.Please help me, its very urgentvenky 解决方案 > First of all is it a good way to do this?We can stop right there, because no, it is not a good way to do this. Itsounds like you''re coming from an ASP background, where Connection Poolingwas not part of the platform. With ASP.Net, your best bet is to open andclose your Connections as quickly as possible, to release them back into thepool.--HTH,Kevin Spencer..Net DeveloperMicrosoft MVPBig things are made upof lots of little things."Venkat Chellam" <ve************@yahoo.com> wrote in messagenews:ac**************************@posting.google.c om... I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows at a page.I have a search criteria to search the records based on the data range i give This is what i have done, in the !IsPostBack section. I am setting up the oracle connection, creating dataset object, datadapter and i aslo load the data from the database into dataset and move all dataset, datadapter, and connection object to session object. Now user can do different operations withe records, like he select a row from grid and there is button on in column of the grid to update , so what i do , update the dataset object for that particular row and then when next time page load is called, i call dataadapter.update to update the data back to the database. so my dataproviders objects are stored in the session object. First of all is it a good way to do this? Second when the session ends, and if the user comes back and does some operation, it going to fail to update because the session variables are destroyed and it will generate an error. What should i do to solve this problem? Or if session object is not a good place to store this dataprovider object, where shoould i store?. My page doesn''t have a user login, i am just using the default session created by asp.net. Please help me, its very urgent venkyThanks for replying. Can you eloborate more what i am suppose to do? Inever worked on asp either, this is the first time i am working withsome webapplication.can you tell me more in detail what ia m suppose to do or some samplecode?venky*** Sent via Developersdex http://www.developersdex.com ***Don''t just participate in USENET...get rewarded for it!Elaborate? Well, when you want to work with your database, open aConnection, do your work, and close it immediately.You may want to create a class of static database utility functions that youcan use whenever you need to connect to your database. I believe Microsoftmakes some of these available, although I''m not sure where (I wrote my own).Hopefully, someone else here can tell you that.--HTH,Kevin Spencer..Net DeveloperMicrosoft MVPBig things are made upof lots of little things."venkat chellam" <ve************@yahoo.com> wrote in messagenews:uv**************@TK2MSFTNGP10.phx.gbl... Thanks for replying. Can you eloborate more what i am suppose to do? I never worked on asp either, this is the first time i am working with some webapplication. can you tell me more in detail what ia m suppose to do or some sample code? venky *** Sent via Developersdex http://www.developersdex.com *** Don''t just participate in USENET...get rewarded for it! 这篇关于会话状态问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 11:04