Connection closed but i open it why?

my code:
GetRecordsByPaging_v4(.......)
OracleCommand CalPgCountRdCount=null;
OracleCommand GetRecordFromPage=null;
try
common.ErrorLog("before " + orlConn.State.ToString());
if (orlConn.State != ConnectionState.Open)
orlConn.Open();
common.ErrorLog("after " + orlConn.State.ToString() + "\r\n");
CalPgCountRdCount = new OracleCommand();
CalPgCountRdCount.CommandText = "Records.CalPgCountRdCount_v3";
CalPgCountRdCount.CommandType = CommandType.StoredProcedure;
CalPgCountRdCount.Connection = orlConn;
CalPgCountRdCount.ExecuteNonQuery(); //here get error:
my error:
stack error: 在 Oracle.DataAccess.Types.OracleRefCursor..ctor(OracleConnection con, IntPtr opsSqlCtx, OpoSqlValCtx* pOpoSqlValCtx, Int32 freeOpsSqlCtx)
在 Oracle.DataAccess.Types.OracleRefCursor..ctor(OracleConnection con, IntPtr opsSqlCtx, OpoSqlValCtx* pOpoSqlValCtx)
在 Oracle.DataAccess.Client.OracleParameter.PostBind_RefCursor(OracleConnection conn, OpoSqlValCtx* pOpoSqlValCtx)
在 Oracle.DataAccess.Client.OracleParameter.PostBind(OracleConnection conn, OpoSqlValCtx* pOpoSqlValCtx, Int32 arraySize)
在 Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
在 Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
在 EC168CH.OracleDAL.DataPaging.GetRecordsByPaging_v4(String strTableName, String strFiledName, String strWhereFiliter, Decimal
error message is : 必须打开连接才能执行此操作( the connection must be open before this operation)
i install ODAC1020221.exe on my server windows 2003 for oracle 10.2 ,i use asp.net 2.0

here is all the code of c#
public DataTable GetRecordsByPaging_v4(string strTableName,
string strFiledName,
string strWhereFiliter,
decimal decPageSize,
decimal decPageIndex,
decimal decOrderType,
out decimal decRecordCount,
out decimal decPageCount)
decRecordCount = 0;
decPageCount = 0;
orlConn = new OracleConnection(common.ConnStr());
DataTable dtData = new DataTable();
OracleCommand CalPgCountRdCount=null;
OracleCommand GetRecordFromPage=null;
OracleConnection orlConn_ora = new OracleConnection(common.ConnStr());
try
common.ErrorLog("before " + orlConn.State.ToString());
if (orlConn.State != ConnectionState.Open)
orlConn.Open();
common.ErrorLog("after " + orlConn.State.ToString() + "\r\n");
orlConn_ora.Open();
CalPgCountRdCount = new OracleCommand();
CalPgCountRdCount.CommandText = "Records.CalPgCountRdCount_v3";
CalPgCountRdCount.CommandType = CommandType.StoredProcedure;
CalPgCountRdCount.Connection = orlConn;
//2
CalPgCountRdCount.Parameters.Add("PageCount", OracleDbType.Decimal);
CalPgCountRdCount.Parameters[0].Direction = ParameterDirection.Output;
//3
CalPgCountRdCount.Parameters.Add("RecordCount", OracleDbType.Decimal);
CalPgCountRdCount.Parameters[1].Direction = ParameterDirection.Output;
//4
CalPgCountRdCount.Parameters.Add("tblName", OracleDbType.Varchar2);
CalPgCountRdCount.Parameters[2].Direction = ParameterDirection.Input;
CalPgCountRdCount.Parameters.Add("strWhere", OracleDbType.Varchar2);
CalPgCountRdCount.Parameters[3].Direction = ParameterDirection.Input;
//7
CalPgCountRdCount.Parameters.Add("PageSize", OracleDbType.Decimal);
CalPgCountRdCount.Parameters[4].Direction = ParameterDirection.Input;
CalPgCountRdCount.Parameters["tblName"].Value = strTableName.Trim();
CalPgCountRdCount.Parameters["strWhere"].Value = strWhereFiliter.Trim();
CalPgCountRdCount.Parameters["PageSize"].Value = decPageSize;
GetRecordFromPage = new OracleCommand();
GetRecordFromPage.CommandText = "Records.GetRecordFromPage_v3";
GetRecordFromPage.CommandType = CommandType.StoredProcedure;
GetRecordFromPage.Connection = orlConn_ora;
//1
GetRecordFromPage.Parameters.Add("ref_cursor", OracleDbType.RefCursor);
GetRecordFromPage.Parameters[0].Direction = ParameterDirection.Output;
GetRecordFromPage.Parameters.Add("tblName", OracleDbType.Varchar2);
GetRecordFromPage.Parameters[1].Direction = ParameterDirection.Input;
//5
GetRecordFromPage.Parameters.Add("fldName", OracleDbType.Varchar2);
GetRecordFromPage.Parameters[2].Direction = ParameterDirection.Input;
//6
GetRecordFromPage.Parameters.Add("strWhere", OracleDbType.Varchar2);
GetRecordFromPage.Parameters[3].Direction = ParameterDirection.Input;
//7
GetRecordFromPage.Parameters.Add("PageSize", OracleDbType.Decimal);
GetRecordFromPage.Parameters[4].Direction = ParameterDirection.Input;
//8
GetRecordFromPage.Parameters.Add("PageIndex", OracleDbType.Decimal);
GetRecordFromPage.Parameters[5].Direction = ParameterDirection.Input;
//9
GetRecordFromPage.Parameters.Add("OrderType", OracleDbType.Decimal);
GetRecordFromPage.Parameters[6].Direction = ParameterDirection.Input;
GetRecordFromPage.Parameters["tblName"].Value = strTableName.Trim();
GetRecordFromPage.Parameters["fldName"].Value = strFiledName.Trim();
GetRecordFromPage.Parameters["strWhere"].Value = strWhereFiliter.Trim();
GetRecordFromPage.Parameters["PageSize"].Value = decPageSize;
GetRecordFromPage.Parameters["PageIndex"].Value = decPageIndex;
GetRecordFromPage.Parameters["OrderType"].Value = decOrderType;
CalPgCountRdCount.ExecuteNonQuery();
decRecordCount = Convert.ToDecimal(CalPgCountRdCount.Parameters["RecordCount"].Value.ToString());
decPageCount = Convert.ToDecimal(CalPgCountRdCount.Parameters["PageCount"].Value.ToString());
if (decRecordCount > 0 && decPageCount > 0)
OracleDataReader drData = GetRecordFromPage.ExecuteReader();
dtData.Load(drData);
catch (Exception err)
string errString = "分页错误:";
if (err.StackTrace != null)
errString += "\r\n错误堆栈:" + err.StackTrace.ToString();
if (err.InnerException != null)
errString += "。\r\n内部错误:" + err.InnerException.Message;
if (err.InnerException.StackTrace != null)
errString += "\r\n内部错误堆栈:" + err.InnerException.StackTrace.ToString();
if (err != null)
string rows = "null";
if (dtData != null)
rows = dtData.Rows.Count.ToString();
Exception er = new Exception(errString + "\r\n" + err.Message + "|| exterl:" + rows + " ;\r\nUrl:" + HttpContext.Current.Request.Url.AbsoluteUri + " \r\nstrTableName:" + strTableName + "\r\nstrFiledName:" + strFiledName + "\r\nstrWhereFiliter:" + strWhereFiliter + "\r\ndecPageSize" + decPageSize + "\r\ndecPageIndex:" + decPageIndex + "\r\ndecOrderType:" + decOrderType);
common.ErrorLog(er);
else
Exception er = new Exception("error is null");
common.ErrorLog(er);
finally
GetRecordFromPage.Dispose();
CalPgCountRdCount.Dispose();
orlConn.Close();
orlConn.Dispose();
orlConn1.Close();
orlConn1.Dispose();
return dtData;
}

Similar Messages

  • TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket in SQL2008R2

    Hello,
    I do get the below SQL error in production environment intermittently:
    TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket.  Consider enabling the TcpAbortiveClose SQL Server registry setting and restarting SQL Server. If the problem persists, contact Technical
    Support.
    According to the post I search in MSDN, the above error is fixed in SQL2008R-CU6, but I have SQL2008R2-SP02 CU09 patch in production environment and the above error still occurred intermittently. I am running SQL2008R2 SP02 CU09 patch with Windows 2008R2-SP01.
    I would like to know if anyone has  the same error happened to their SQL environment after applied SQL2008R2-SP02 CU06 patch and later.
    Any suggestion would be helpful.
    Best regards,
    PL.

    Hello,
    What happen if you apply the changes on the registry explained on the workaround section of the following article?
    http://support.microsoft.com/kb/2491214
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • A/P Invoice Closed but Rows Open...

    Hello Experts,
    Scenario:
    An A/P Invoice made from GRPOs. Now the situation is this that A/P invoice is closed but there is not Target document, I mean A/P is closed without Target Document. But this A/P Invoice is not manually Closed i.e. Closed by the system.
    Also all the ROWS are open of this said A/P invoice.
    There is another situation from where I caught it, is the Inventory Posting List. This A/P invoice has a valule but in Inventory Posting List it shows ZERO (0) Value against this (PU) A/P invoice.
    Help Required,
    Thanks & Regards,

    hi,
    ap invoice rows get closed if you create ap credit memo frm ap invoice,
    but why are worried about row status in ap invoice,since document status is already closed.
    inventory posting list records price when u receive goods,since ur doing grpo hence price
    is shown posting list where it enters,if u do ap invoice without creating grpo then price should
    be corrosponding to ap invoice.
    Hope it solves problem.
    Jeyakanthan

  • Photoshop stopped downloading and would not resume. says connection problem but there is none. why?

    why make software  that does not work? tried to download photoshop 13 hours later at 55 % it paused and would not restart. then gave error code 109 says no connection but there is no problem and the hd is 1 tb and empty so whats the deal?

    Please refer : http://helpx.adobe.com/creative-suite/kb/troubleshoot-download-assistant.html
    Alternatively, you can try downloading from the direct downloaded links provided at : http://prodesigntools.com/adobe-cs6-direct-download-links.html
    But make sure you follow the important instrctions on the page before initiating the download.

  • I can see my project in the movies folder but cannot open it, why?

    I have been working on a project for three hours, the FCP quits unexpectedly and when I restart the prgram the project is gone as if I never started it. I can see the project in the Movies folder but it will not open. What am i doing wrong?

    Can you provide us with a screen grab of the folder so we can see the current structure.

  • FMLE Keeps disconnecting. It says "primary - Network Status: NetConnection.Connect.Closed" every 30 seconds? Why?

    I am trying to stream on Twitch. I am using Camtwist and FMLE.

    Hi
    I think i found the sollution or at least I hope i was able to stream for 5 min without any interruption. So here are my settings for the video option my incoming settings ( assuming you are using the blackmagic intensity to get the footage in) are Blackmagic HD 720p 59.94 -8bit ( that setting only works if you can set your output on the camera to 720, you still can record in full HD on my camera they are two indepnt settings. ) if you can not downsample the video to 720 you have to use Blackmagic HD 1080i 59.94 - 8bit. Your input size for the 720p setting can be almost everyhing in the 700 or lower range. for the 1080i i only can choose the 1920 setting. So I am using the 720p setting for format I use H.264 and here is what trickered the interruption the frame rate your frame rate needs to be at 59.94 and i also have my aspect ratio checked on blackmagic audio the settings can be anything and voila it worked not interruption
    hope that helps so even if you not use black magic see if you can get the frame rate settings all to the same

  • After upgrading to OX mountain lion my apps store doesn't open. App Store cannot verify a secure connection with the App Store. My internet connection is ok but i don't why this happening. What should i do?

    After upgrading to OX mountain lion my apps store doesn't open. App Store cannot verify a secure connection with the App Store. My internet connection is ok but i don't why this happening. What should i do?

    Hi Tahan007,
    Check these threads out:
    Cannot connect to the App Store since upgrading to Mountain Lion.
    Cannot connect to App Store since 10.8.1
    why is my app store sign in saying connection failed?
    Also if you're running any anti-virus SW, you might try temporarily disabling it

  • Why my iphone 4 connect to wifi, but when i open safari and search something it say i not connect.. but in the same house my sister using iphone4 too but she can online with the same router

    why my iphone 4 connect to wifi, but when i open safari and search something it say i not connect.. but in the same house my sister using iphone4 too but she can online with the same router. i go and check over the detail of the network i connected, over the ip address and subnet mask have the numbers, but over the DNS and router don't have any number...isit the problem???? i can online at any other place but just my home cant...y????

    Hey confuddled_chica!
    Try the steps in the article below to troubleshoot this issue:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • Why does my computer say its connected through wi-fi but wont open a web page, why does my computer say its connected through wi-fi but wont open a web page but will work if im hardwired into the internet

    my computer is showing full connection through the airport but wont open any web pages it says it is not connected to the internet... When i hard wire the internet in with the cord it works just fine so i think i somehow messed up or turned of my wi fi capability but i show my airport is on

    Your computer is showing it's connected to the Wifi router all right, but perhaps the router isn't connected to the Internet.
    If your connecting the Ethernet cable directly to the modem and resetting it, bypassing th erouter and then getting online, fine that's good.
    If your connecting to the router directly and getting on the Internet fine, it means the router is connected to the Internet.
    If the last one is true then likely what has occured is your DCHP lease is expired because your computer doesn't have the right time and date as the router, it's showing a good signal but your not connecting.
    Open System Preference and check the date and time and set it to update to Apple's time server for your location.
    Sometimes Apple's time is off, as third party routers get their time elsewhere and sometimes the two don't match and thus DCHP lease is expired.
    ..WiFi, Internet problems, possible solutions

  • I go to touch an app or game button on my iPhone and the screen blinks like its trying to open, but nothing happens. Why and what do I do?

    I go to touch an app or game button on my iPhone and the screen blinks like its trying to open, but nothing happens. Why and what do I do to fix it?

    Are there any apps in the muti-tasking bar? If the app closed unexpectedly and appeared in the muti-tasking bar, end it. Double tap the home button and then hold the app until it starts to wiggle then tap the minus at the top left at the app (if you want, end all the remaining apps)  try opening them now. Hope this helps! :)

  • Why is live chat closed during stated open times?

    I tried asking a question in this forum yesterday. No reply. Today I asked why the live chat is closed during posted open times. I am so frustrated that I don't know what to do. The suggested answers to this question didn't even come close to answering it and yesterday the same problem occurred with my original question about mail attachments. Is there some way to talk with a live person either through email, chat, or phone? Please help

    I understand about the volunteers, but what about my original question concerning my inability to add an attachment from my Mac documents to an email? I still don't know what the problem is or how to fix it. When I follow the directions on doing an attachment, my entire computer freezes up to the point of having to unplug it and start over. Not a good solution to a frozen computer, and even as computer illiterate as I am, I know this is not a good way to go. I also cannot resume downloading Firefox 3.6.13. I get absolutely nothing when I try except another issue with a frozen computer.

  • Wifi connected but cant open web sites

    I use my Ipad for email and surfing whilst traveling at air ports and hotesl.
    Now some wifi sites ok but others sites I get connected but cant open web pages
    WHY any ideas to fix problem

    If you gave some examples of which locations caused problems and details on what happened it would help to give advice. There are many different types of "free" WiFi at these sorts of places. The mechanisms used to allow you to access the wifi are varied, i.e., agreement web pages, credentials, userid/password, etc.
    In some cases, the Safari Autofill feature has interfered with the sign on mechanism used. If this is the case this feature can be turned Off by going to Settings > Safari > Autofill and turning it Off.

  • Hi, I've recently bought an iPad2 and can't get connected with AppStore or iTunes, when I tap on these icons a grey page pops up saying is loading but never opens the page, no failure message is displayed, it just keep saying is loading. Apparently it is

    Hi, I’ve recently bought an iPad2 and can’t get connected with AppStore or iTunes, when I tap on these icons a grey page pops up saying is loading but never opens the page, no failure message is displayed, it just keep saying is loading.
    Apparently it is not an issue with wifi since Safari, You Tube and Maps work well, I’ve tried some of the tips, e.g. log off/on my Id, change password but no one worked.
    Your help will be highly appreciated.
    Thank you.
    Luis.

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • I receive many e-mails with zipped files.  In the past few weeks I can no longer open them as I used to.  I get a window welcoming me to the Application Loader.  ( What is an Application Loader?)  It says I need my iTunes Connect login, but when I try my

    I receive many e-mails with zipped files.  I can no longer open or unzip my files. A window welcoming me to Application Loader drops down.  It prompts for an iTunes Connect login, but will no accept my iTunes login. I have no way to open or unzip my files. Help!!!!

    Application Loader, unless there's another one I'm not familiar with, is part of the iOS SDK. That have usurped the .zip, or you may have removed that application but your Mac is still holding onto the mapping of Zip files to that application. Select a .zip file in Finder, Get Info, and go to the Open with section. Select Archive Utility and click Change All. That should fix the problem.
    Regards.

  • HT201253 iPhone 5s is not recognized by iTunes - when I connect my iPhone, iPhoto opens and the phone begins charging but iTunes does not recognize it and I cannot sync.  Any advice?

    when I connect my iPhone, iPhoto opens and the phone begins charging but iTunes does not recognize it and I cannot sync.  Any advice?

    Howdy AndieKanaras,
    It sounds like your iPhone is being recognized everywhere but in iTunes. I would use the troubleshooting for that issue in the following article, named:
    If you don't see your connected device in iTunes for Mac
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

Maybe you are looking for