3 Replies Latest reply on Mar 1, 2017 9:28 AM by tdanner

    Is there a way to read the Orion db using SqlConnection?

    fostej

      We are trying to create a business-use status page for folks that do not have a technical need.  A simple page with "Up, Warning, Down" icons.  I have downloaded the OrionSDK and have found very little information within. What few examples I am finding, they all use a Jtoken which I am relatively unfamiliar with its use.  This is what I am trying to do, but I am getting a connection refused.

       

      public DataTable ConnectToDatabase()

      {

          string connectionString = ("Server=" + _hostname + ";Database=Orion.SEUM;User Id=" + _username + ";Password=" + _password + ";Trusted_Connection=False;");

          SqlConnection mySql = new SqlConnection(connectionString);

          SqlCommand query = new SqlCommand("SELECT TransactionId, Name, Status, LastPlayedUtc FROM Orion.SEUM.Transactions", mySql);

       

          DataTable dt = new DataTable("BusinessUseStatus");

       

          try

          {

              mySql.Open();

              dt.Load(query.ExecuteReader());

          }

          catch (Exception ex)

          {

              Debug.WriteLine(ex.Message);

          }

          finally

          {

              mySql.Close();

          }

       

          return dt;

      }