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

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

4 Examples 7

1. Example

View license
[Fact]
    public void SelectWithComplexType()
    {
      MySqlDataAdapter da = new MySqlDataAdapter("SELECT c.LastName FROM Employees AS c WHERE c.Age > 20", st.conn);
      DataTable dt = new DataTable();
      da.Fill(dt);

      using (testEntities context = new testEntities())
      {
        string eSql = @"SELECT c.LastName FROM Employees AS c WHERE c.Age > 20";
        ObjectQuery<DbDataRecord> query = context.CreateQuery<DbDataRecord>(eSql);

        string sql = query.ToTraceString();
        st.CheckSql(sql, SQLSyntax.SelectWithComplexType);

        int i = 0;
        foreach (DbDataRecord s in query)
          Assert.Equal(dt.Rows[i++][0], s.GetString(0));
      }
    }

2. Example

Project: mysql-connector-net
Source File: Wizard.cs
View license
[Fact]
    public void SelectAllTables()
    {
      st.execSQL("CREATE TABLE IF NOT EXISTS test (id int)");

      System.Data.DataTable dt = st.conn.GetSchema("Tables");

      using (EntityConnection ec = GetConnection())
      {
        using (SchemaInformation si = new SchemaInformation(ec))
        {
          int i = 0;
          var q = si.Tables.Select("it.CatalogName, it.SchemaName, it.Name").OrderBy("it.Name, it.SchemaName");
          foreach (DbDataRecord t in q)
            Assert.Equal(dt.Rows[i++]["TABLE_NAME"], t.GetString(2));
        }
      }
    }

3. Example

Project: mysql-connector-net
Source File: Wizard.cs
View license
[Fact]
    public void SelectAllViews()
    {
      st.execSQL("CREATE TABLE IF NOT EXISTS test(id int)");
      st.execSQL("CREATE VIEW view1 as SELECT * FROM test");

      System.Data.DataTable dt = st.conn.GetSchema("Views");

      using (EntityConnection ec = GetConnection())
      {
        using (SchemaInformation si = new SchemaInformation(ec))
        {
          int i = 0;
          var q = si.Views.Select("it.CatalogName, it.SchemaName, it.Name").OrderBy("it.Name, it.SchemaName");
          foreach (DbDataRecord t in q)
            Assert.Equal(dt.Rows[i++]["TABLE_NAME"], t.GetString(2));
        }
      }
    }

4. Example

Project: mysql-connector-net
Source File: JoinTests.cs
View license
[Fact]
    public void JoinOfUnionsOnRightSideofJoin()
    {
      using (testEntities context = new/n ..... /n //View Source file for more details /n }