Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未清除asp.net数据库会话_Asp.net_Oracle_Locking_Connection - Fatal编程技术网

未清除asp.net数据库会话

未清除asp.net数据库会话,asp.net,oracle,locking,connection,Asp.net,Oracle,Locking,Connection,我正在使用sqldatasource连接asp.net中的oracle数据库,这是我的连接字符串 <add name="ConnectionString3" connectionString="Data Source=sml; User ID=sml; Password=sml; Unicode=True; Pooling=False;" providerName="System.Data.OracleClient"/> 你试过c#“using”语法吗 此处有更多详细信息:您是否已

我正在使用sqldatasource连接asp.net中的oracle数据库,这是我的连接字符串

<add name="ConnectionString3" connectionString="Data Source=sml; User ID=sml; Password=sml; Unicode=True; Pooling=False;" providerName="System.Data.OracleClient"/>
你试过c#“using”语法吗


此处有更多详细信息:

您是否已检查oracle中连接已锁定的用户。试着探索一下。它可以给你一些想法。你应该使用try、catch、finally或@Geg Smithusing建议的try-catch。一个会话已删除,但存在一个处于锁定状态的sill-one。会话为何变为锁定状态?你是否也使用事务?如果你使用try,catch和in finally如果要在finally块中关闭连接,则不应该有任何锁定会话。Asp.net本身执行连接池。意味着它不会关闭所有连接,它会为下一个请求保留一些打开的连接。但在这种情况下,它也不应该被锁定。
 Dim con = New OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle; Pooling=false")
    Try
        con.Open()
        Dim cmd As New OleDbCommand("SELECT UPDTIME, YBAL_J, SCROLL_J, PENDING_PMT_J, YBAL_B, SCROLL_B, PENDING_PMT_B, CR_DT, OUT_BAL_J, OUT_BAL_B,SUGAR_J,CANE_CRUSH_J,RECOVERY_J,ETHANOL_J,SHEET_J,SUGAR_B,CANE_CRUSH_B,RECOVERY_B,ETHANOL_B FROM CMS20122013.V_DASH_LABELS@CMS", con)

        Dim da As New OleDbDataAdapter(cmd)
        Dim ds As New DataSet
        da.Fill(ds)

        Label1.Text = ds.Tables(0).Rows(0)(0).ToString
        Label5.Text = ds.Tables(0).Rows(0)(0).ToString
        Label2.Text = ds.Tables(0).Rows(0)(1).ToString
        Label3.Text = "Scroll Issued: " & ds.Tables(0).Rows(0)(2).ToString
        Label4.Text = "Payment Pending: " & ds.Tables(0).Rows(0)(3).ToString
        Label6.Text = ds.Tables(0).Rows(0)(4).ToString
        Label7.Text = "Scroll Issued: " & ds.Tables(0).Rows(0)(5).ToString
        Label8.Text = "Payment Pending: " & ds.Tables(0).Rows(0)(6).ToString
        Label14.Text = ds.Tables(0).Rows(0)(7).ToString
        GridView4.Columns(4).HeaderText = ds.Tables(0).Rows(0)(8).ToString
        GridView9.Columns(4).HeaderText = ds.Tables(0).Rows(0)(9).ToString
        GridView2.Columns(0).HeaderText = "Crushing [" & ds.Tables(0).Rows(0)(11).ToString & "]"
        GridView7.Columns(0).HeaderText = "Crushing [" & ds.Tables(0).Rows(0)(16).ToString & "]"
        con.Close()
        con.Dispose()
    Catch ex As Exception
        con.Close()
        con.Dispose()
    Finally
        con.Close()
        con.Dispose()
    End Try
using(var connection = new OracleConnection("some connection string"))
{
     connection.Open();

     //do stuff with connection
}