示例#1
0
        /// <summary>
        /// Test CUBRIDDataReader getter methods
        /// </summary>
        private static void Test_DataReader_Getxxx()
        {
            using (CUBRIDConnection conn = new CUBRIDConnection())
            {
                conn.ConnectionString = TestCases.connString;
                conn.Open();

                string sql = "select * from nation;";
                using (CUBRIDCommand cmd = new CUBRIDCommand(sql, conn))
                {
                    using (CUBRIDDataReader reader = (CUBRIDDataReader)cmd.ExecuteReader())
                    {
                        reader.Read();

                        Debug.Assert(reader.GetOrdinal("code") == 0);
                        Debug.Assert(reader.GetName(0) == "code");
                        Debug.Assert(reader.GetColumnName(0) == "code");
                        Debug.Assert(reader.GetColumnType(0) == typeof(System.String));
                        Debug.Assert(reader.GetDataTypeName(0) == "CHAR");
                    }
                }
            }
        }