Session lost after using oracle connection RRS feed

  • Question

  • User325035487 posted
    using Oracle.ManagedDataAccess.Client;
    using Oracle.ManagedDataAccess.Types;
      //Inside my Code Block
    string connection = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracleserver)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=username;Password=admin;"; OracleConnection ordb = new OracleConnection(connection); ordb.Open(); var sql_t = "SELECT sm.staff_id staff_id, sm.staff_name_1 || ' ' || sm.staff_name_2 || ' ' || sm.staff_name_3 || ' ' || sm.staff_name_family staff_name,"+ "TO_CHAR (sm.date_in_kingdom, 'dd-mm-yyyy') hire_date" + " FROM staff_master sm WHERE sm.staff_id = '1234'"; OracleCommand cmd = new OracleCommand(sql_t, ordb); OracleDataReader dr = cmd.ExecuteReader(); // C# dr.Read(); <p>@dr.GetString(0).ToString(), @dr.GetString(1).ToString(),@dr.GetString(2).ToString(),</p> ordb.Close();

    This page is working fine and returning data. But whenever I run this page the user is logged out. I cant figure out whats the problem. I user Razor 3 site. Main database is MS SQL. But connecting to and existing OracleServer to import data into my MS SQL Server.

    Any ideas why the session lost after executing this code

    Wednesday, August 19, 2015 3:58 AM


  • User325035487 posted

    Please cancel this thread. As I found my issue had nothing to do with the oracle connection. But to do with my session timeout and force session value clear in case someone browse to a URL directly without logging In first.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 19, 2015 11:08 AM