Ejemplo n.º 1
0
        private static void TestSerialize()
        {
            SQLWebProxyResultOk ok = new SQLWebProxyResultOk();
            string xml = ok.ToXml();

            SQLWebProxyResultError error = new SQLWebProxyResultError();
            error.Error = "Alles doof";
            xml = error.ToXml();
            error.Error = "Nu is weg";
            error = SQLWebProxyResultError.FromXml(xml) as SQLWebProxyResultError;

            SQLWebProxyResultNonQuery nonquery = new SQLWebProxyResultNonQuery();
            nonquery.Value = 42;
            xml = nonquery.ToXml();
            nonquery.Value = 0;
            nonquery = SQLWebProxyResultNonQuery.FromXml(xml) as SQLWebProxyResultNonQuery;

            SQLWebProxyResultScalar scalar = new SQLWebProxyResultScalar();
            scalar.ScalarValue = "Hallo Welt!";
            xml = scalar.ToXml();
            scalar.ScalarValue = null;
            scalar = SQLWebProxyResultScalar.FromXml(xml) as SQLWebProxyResultScalar;

            scalar = new SQLWebProxyResultScalar();
            scalar.ScalarValue = (short)42;
            xml = scalar.ToXml();
            scalar.ScalarValue = null;
            scalar = SQLWebProxyResultScalar.FromXml(xml) as SQLWebProxyResultScalar;

            scalar = new SQLWebProxyResultScalar();
            scalar.ScalarValue = 47.11;
            xml = scalar.ToXml();
            scalar.ScalarValue = null;
            scalar = SQLWebProxyResultScalar.FromXml(xml) as SQLWebProxyResultScalar;

            SQLWebProxyResultReader reader = new SQLWebProxyResultReader();
            List<object[]> rowList = new List<object[]>();
            rowList.Add(new object[] { 4711, "Test123", "Super", 0.01 });
            rowList.Add(new object[] { 4711, 999, null, "Willi" });
            reader.Rows = rowList.ToArray();
            xml = reader.ToXml();
            reader.Rows = null;
            reader = SQLWebProxyResultReader.FromXml(xml) as SQLWebProxyResultReader;
        }
Ejemplo n.º 2
0
 private string ConstructScalar(object obj)
 {
     SQLWebProxyResultScalar scalar = new SQLWebProxyResultScalar();
     scalar.ScalarValue = obj;
     return scalar.ToXml();
 }