/// <summary> /// This will only be used if the server is linked to MYSQL, This will be changed. /// </summary> /// <param name="Query"></param> /// <param name="useParentconnection"></param> /// <param name="args"></param> /// <returns></returns> public bool SetDataTable(string Query, bool useParentconnection, params string[] args) { bool Result = false; if (Connect()) { BinaryBuffer buff = new BinaryBuffer(); buff.BeginWrite(); args = args ?? new string[] { }; buff.Write(1); buff.Write(args.Length); for (int i = 0; i < args.Length; i++) { buff.WriteField(args[i]); } buff.Write((byte)0); buff.WriteField(Query); buff.EndWrite(); try { Database.WriteBuffer(buff.ByteBuffer, _TcpClient.GetStream()); byte[] data = Database.ReadBuffer(_TcpClient.GetStream()); BinaryBuffer buffRead = new BinaryBuffer(data); buffRead.BeginRead(); buffRead.ReadInt(); Result = buffRead.ReadByte() == (byte)1; buffRead.EndRead(); } catch (Exception) { } if (!useParentconnection) { Disconnect(); } } return(Result); }
/// <summary> /// This will only be used if the server is linked to MYSQL, This will be changed. /// </summary> /// <param name="Query"></param> /// <param name="useParentconnection"></param> /// <param name="args"></param> /// <returns></returns> public bool SetDataTable(string Query, bool useParentconnection, params string[] args) { bool Result = false; if (Connect()) { BinaryBuffer buff = new BinaryBuffer(); buff.BeginWrite(); args = args ?? new string[] { }; buff.Write(1); buff.Write(args.Length); for (int i = 0; i < args.Length; i++) buff.WriteField(args[i]); buff.Write((byte)0); buff.WriteField(Query); buff.EndWrite(); try { Database.WriteBuffer(buff.ByteBuffer, _TcpClient.GetStream()); byte[] data = Database.ReadBuffer(_TcpClient.GetStream()); BinaryBuffer buffRead = new BinaryBuffer(data); buffRead.BeginRead(); buffRead.ReadInt(); Result = buffRead.ReadByte() == (byte)1; buffRead.EndRead(); } catch (Exception) { } if (!useParentconnection) Disconnect(); } return Result; }