System.Data.Common.DbDataRecord.GetDouble(int)

Here are the examples of the csharp api class System.Data.Common.DbDataRecord.GetDouble(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: mysql-connector-net
Source File: AggregateOperators.cs
[Fact]
    public void MinWithPredicate()
    {
      MySqlCommand trueCmd = new MySqlCommand("SELECT MIN(Freight) FROM Orders WHERE shopId=2", st.conn);
      object freight = trueCmd.ExecuteScalar();

      using (testEntities context = new testEntities())
      {
        string eSql = "SELECT Min(o.Freight) FROM Orders AS o WHERE o.Shop.Id = 2";
        ObjectQuery<DbDataRecord> q = context.CreateQuery<DbDataRecord>(eSql);

        string sql = q.ToTraceString();
        st.CheckSql(sql, SQLSyntax.MinWithPredicate);

        foreach (DbDataRecord r in q)
        {
          Assert.Equal(Convert.ToDouble(freight), r.GetDouble(0));
        }
      }
    }

2. Example

Project: mysql-connector-net
Source File: AggregateOperators.cs
[Fact]
    public void MaxWithPredicate()
    {
      MySqlCommand trueCmd = new MySqlCommand("SELECT MAX(Freight) FROM Orders WHERE shopId=1", st.conn);
      object freight = trueCmd.ExecuteScalar();

      using (testEntities context = new testEntities())
      {
        string eSql = "SELECT MAX(o.Freight) FROM Orders AS o WHERE o.Shop.Id = 1";
        ObjectQuery<DbDataRecord> q = context.CreateQuery<DbDataRecord>(eSql);

        string sql = q.ToTraceString();
        st.CheckSql(sql, SQLSyntax.MaxWithPredicate);

        foreach (DbDataRecord r in q)
          Assert.Equal(Convert.ToDouble(freight), r.GetDouble(0));
      }
    }