本文整理匯總了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