Пример #1
0
        public void TestGetSqlXml(TestCaseResult result)
        {
            InsertRowText();

            VirtuosoCommand cmd = connection.CreateCommand();

            cmd.CommandText = "select data from xmlt";

            VirtuosoDataReader rdr = cmd.ExecuteReader();

            rdr.Read();
            SqlXml x = rdr.GetSqlXml(0);

            FailIfXmlNotEqual(result, x.ToString(), TheXml);
        }
Пример #2
0
        public void TestGetValue(TestCaseResult result)
        {
            InsertRowText();

            VirtuosoCommand cmd = connection.CreateCommand();

            cmd.CommandText = "select data from xmlt";

            VirtuosoDataReader rdr = cmd.ExecuteReader();

            rdr.Read();
            object obj = rdr.GetValue(0);

            result.FailIfNotEqual(typeof(SqlXml).Name, obj.GetType().Name);
            SqlXml x = (SqlXml)obj;

            FailIfXmlNotEqual(result, x.ToString(), TheXml);
        }
Пример #3
0
        public void TestInsertSqlXml(TestCaseResult result)
        {
            VirtuosoCommand insert = connection.CreateCommand();

            insert.CommandText = "insert into xmlt (id, data) values (1, ?)";
            insert.Parameters.Add(new VirtuosoParameter(":0", new SqlXml(TheXml)));
            insert.ExecuteNonQuery();
            insert.Dispose();

            VirtuosoCommand cmd = connection.CreateCommand();

            cmd.CommandText = "select data from xmlt";

            VirtuosoDataReader rdr = cmd.ExecuteReader();

            rdr.Read();
            SqlXml x = rdr.GetSqlXml(0);

            FailIfXmlNotEqual(result, x.ToString(), TheXml);
        }