本文整理汇总了C#中MySql.Data.MySqlClient.MySqlPacket.SetByte方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlPacket.SetByte方法的具体用法?C# MySqlPacket.SetByte怎么用?C# MySqlPacket.SetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlPacket
的用法示例。
在下文中一共展示了MySqlPacket.SetByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendQuery
/// <summary>
/// Query is the method that is called to send all queries to the server
/// </summary>
public void SendQuery(MySqlPacket queryPacket)
{
warnings = 0;
queryPacket.SetByte(4, (byte)DBCmd.QUERY);
ExecutePacket(queryPacket);
// the server will respond in one of several ways with the first byte indicating
// the type of response.
// 0 == ok packet. This indicates non-select queries
// 0xff == error packet. This is handled in stream.OpenPacket
// > 0 = number of columns in select query
// We don't actually read the result here since a single query can generate
// multiple resultsets and we don't want to duplicate code. See ReadResult
// Instead we set our internal server status flag to indicate that we have a query waiting.
// This flag will be maintained by ReadResult
serverStatus |= ServerStatusFlags.AnotherQuery;
}
示例2: ExecuteStatement
public void ExecuteStatement(MySqlPacket packetToExecute)
{
warnings = 0;
packetToExecute.SetByte(4, (byte)DBCmd.EXECUTE);
ExecutePacket(packetToExecute);
serverStatus |= ServerStatusFlags.AnotherQuery;
}