コード例 #1
0
		public CommandResult(Packet p, Driver d)
		{
			driver = d;
			packet = p;
			fieldCount = (int)p.ReadLenInteger();
			if (fieldCount == 0)
				affectedRows =(int)p.ReadLenInteger();
		}
コード例 #2
0
ファイル: CommandResult.cs プロジェクト: raj581/Marvin
 public CommandResult(Packet p, Driver d)
 {
     driver     = d;
     packet     = p;
     fieldCount = (int)p.ReadLenInteger();
     if (fieldCount == 0)
     {
         affectedRows = (int)p.ReadLenInteger();
     }
 }
コード例 #3
0
        public CommandResult Send(DBCmd cmd, byte[] bytes)
        {
//			string s = Encoding.GetString( bytes );

            Packet packet = CreatePacket(null);

            packetSeq = 0;
            packet.WriteByte((byte)cmd);
            if (bytes != null)
            {
                packet.Write(bytes, 0, bytes.Length);
            }

            SendPacket(packet);
            packet = ReadPacket();

            // first check to see if this is a LOAD DATA LOCAL callback
            // if so, send the file and then read the results
            long fieldcount = packet.ReadLenInteger();

            if (fieldcount == Packet.NULL_LEN)
            {
                string filename = packet.ReadString();
                SendFileToServer(filename);
                packet = ReadPacket();
            }
            else
            {
                packet.Position = 0;
            }

            return(new CommandResult(packet, this));
        }
コード例 #4
0
ファイル: CommandResult.cs プロジェクト: raj581/Marvin
 public bool NextField()
 {
     if (fieldLength >= 0)
     {
         packet.Position += fieldLength;
     }
     if (!packet.HasMoreData)
     {
         return(false);
     }
     fieldLength = packet.ReadLenInteger();
     fieldsRead++;
     return(true);
 }