本文整理汇总了C#中Npgsql.NpgsqlConnector.AddParameterStatus方法的典型用法代码示例。如果您正苦于以下问题:C# NpgsqlConnector.AddParameterStatus方法的具体用法?C# NpgsqlConnector.AddParameterStatus怎么用?C# NpgsqlConnector.AddParameterStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Npgsql.NpgsqlConnector
的用法示例。
在下文中一共展示了NpgsqlConnector.AddParameterStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessBackendResponses_Ver_3
//.........这里部分代码省略.........
PGUtil.ReadInt32(stream);
yield return new CompletedResponse(stream);
break;
case BackEndMessageCode.ParseComplete:
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "ParseComplete");
// Just read up the message length.
PGUtil.ReadInt32(stream);
yield break;
case BackEndMessageCode.BindComplete:
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "BindComplete");
// Just read up the message length.
PGUtil.ReadInt32(stream);
yield break;
case BackEndMessageCode.EmptyQueryResponse:
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "EmptyQueryResponse");
PGUtil.ReadInt32(stream);
break;
case BackEndMessageCode.NotificationResponse:
// Eat the length
PGUtil.ReadInt32(stream);
context.FireNotification(new NpgsqlNotificationEventArgs(stream, true));
if (context.IsNotificationThreadRunning)
{
yield break;
}
break;
case BackEndMessageCode.ParameterStatus:
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "ParameterStatus");
NpgsqlParameterStatus parameterStatus = new NpgsqlParameterStatus(stream);
NpgsqlEventLog.LogMsg(resman, "Log_ParameterStatus", LogLevel.Debug, parameterStatus.Parameter,
parameterStatus.ParameterValue);
context.AddParameterStatus(parameterStatus);
if (parameterStatus.Parameter == "server_version")
{
// Deal with this here so that if there are
// changes in a future backend version, we can handle it here in the
// protocol handler and leave everybody else put of it.
string versionString = parameterStatus.ParameterValue.Trim();
for (int idx = 0; idx != versionString.Length; ++idx)
{
char c = parameterStatus.ParameterValue[idx];
if (!char.IsDigit(c) && c != '.')
{
versionString = versionString.Substring(0, idx);
break;
}
}
context.ServerVersion = new Version(versionString);
}
break;
case BackEndMessageCode.NoData:
// This nodata message may be generated by prepare commands issued with queries which doesn't return rows
// for example insert, update or delete.
// Just eat the message.
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "ParameterStatus");
PGUtil.ReadInt32(stream);
break;
case BackEndMessageCode.CopyInResponse:
// Enter COPY sub protocol and start pushing data to server
NpgsqlEventLog.LogMsg(resman, "Log_ProtocolMessage", LogLevel.Debug, "CopyInResponse");
ChangeState(context, NpgsqlCopyInState.Instance);
PGUtil.ReadInt32(stream); // length redundant