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); }
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); }
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); }