public GetColumnSetsResponseMessage(Guid requestID, ColumnSet[] columnSets, Exception exception)
 {
     if (columnSets == null)
         throw new ArgumentNullException ("columnSets");
     this.requestID = requestID;
     this.columnSets = columnSets;
     this.exception = exception;
 }
Example #2
0
File: Row.cs Project: vebin/BD2
 public Row(ColumnSet columnSet, object[] fields)
 {
     if (fields == null)
         throw new ArgumentNullException ("fields");
     this.columnSet = columnSet;
     this.fields = fields;
     if (columnSet.Columns.Length != fields.Length)
         throw new Exception ();
 }
Example #3
0
 public void AddColumnSet(ColumnSet columnSet)
 {
 }
Example #4
0
 List<BD2.Conv.Frontend.Table.Row> readRowsData(SqlConnection connection, SqlCommand command, SqlDataReader reader, Table table)
 {
     Console.WriteLine ("readRowsData()");
     List<BD2.Conv.Frontend.Table.Row> rows = new List<BD2.Conv.Frontend.Table.Row> ();
     object[] values;
     //SortedDictionary<string, Column> table = tableColumns [context.Table.SqlTableID];
     string[] rowTFQNs = new string[reader.FieldCount];
     BD2.Conv.Frontend.Table.Column[] cols = new BD2.Conv.Frontend.Table.Column[reader.FieldCount];
     for (int n = 0; n != reader.FieldCount; n++) {
         cols [n] = psc.GetColumnByName (table, reader.GetName (n));
         rowTFQNs [n] = cols [n].TFQN;
     }
     int rc = 0;
     ColumnSet columnSet = new ColumnSet (cols);
     while (reader.Read ()) {
         rc++;
         values = new object[reader.FieldCount];
         reader.GetValues (values);
         BD2.Conv.Frontend.Table.Row r = new BD2.Conv.Frontend.Table.Row (columnSet, values);
         rows.Add (r);
     }
     reader.Close ();
     connection.Close ();
     return rows;
 }
Example #5
0
        public static Row Deserialize(byte[] bytes)
        {
            using (System.IO.MemoryStream MS = new System.IO.MemoryStream(bytes, false)) {
                using (System.IO.BinaryReader BR = new System.IO.BinaryReader(MS)) {
                    byte[]    columnSet  = BR.ReadBytes(32);
                    int       FieldCount = BR.ReadInt32();
                    object[]  fields     = new object[FieldCount];
                    ColumnSet cs         = css [columnSet];
                    if (cs.Columns.Length != fields.Length)
                    {
                        throw new Exception();
                    }
                    for (int n = 0; n != fields.Length; n++)
                    {
                        bool Null = BR.ReadBoolean();
                        if (Null)
                        {
                            fields [n] = null;
                            continue;
                        }
                        switch (cs.Columns [n].TFQN)
                        {
                        case "System.Byte[]":
                            fields [n] = BR.ReadBytes(BR.ReadInt32());
                            break;

                        case "System.Byte":
                            fields [n] = BR.ReadByte();
                            break;

                        case "System.SByte":
                            fields [n] = BR.ReadSByte();
                            break;

                        case "System.Int16":
                            fields [n] = BR.ReadInt16();
                            break;

                        case "System.UInt16":
                            fields [n] = BR.ReadUInt16();
                            break;

                        case "System.Int32":
                            fields [n] = BR.ReadInt32();
                            break;

                        case "System.UInt32":
                            fields [n] = BR.ReadUInt32();
                            break;

                        case "System.Int64":
                            fields [n] = BR.ReadInt64();
                            break;

                        case "System.UInt64":
                            fields [n] = BR.ReadUInt64();
                            break;

                        case "System.Single":
                            fields [n] = BR.ReadSingle();
                            break;

                        case "System.Double":
                            fields [n] = BR.ReadDouble();
                            break;

                        case "System.String":
                            fields [n] = BR.ReadString();
                            break;

                        case "System.Char":
                            fields [n] = BR.ReadChar();
                            break;

                        case "System.Boolean":
                            fields [n] = BR.ReadBoolean();
                            break;

                        case "System.DateTime":
                            fields [n] = new DateTime(BR.ReadInt64());
                            break;

                        case "System.Guid":
                            fields [n] = new Guid(BR.ReadBytes(16));
                            break;
                        }
                    }
                    return(new Row(cs, fields));
                }
            }
        }
Example #6
0
 public static void AddColumnSet(ColumnSet columnSet)
 {
     css.AddOrUpdate(columnSet.GetHash(), (hash) => columnSet, (hash, ocs) => {
         throw new Exception();
     });
 }
Example #7
0
File: Row.cs Project: vebin/BD2
 public static void AddColumnSet(ColumnSet columnSet)
 {
     css.AddOrUpdate (columnSet.GetHash (), (hash) => columnSet, (hash,ocs) => {
         throw new Exception ();
     });
 }