当前位置: 首页>>代码示例>>C#>>正文


C# TdsParserStateObject.ReadInt32方法代码示例

本文整理汇总了C#中System.Data.SqlClient.TdsParserStateObject.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# TdsParserStateObject.ReadInt32方法的具体用法?C# TdsParserStateObject.ReadInt32怎么用?C# TdsParserStateObject.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SqlClient.TdsParserStateObject的用法示例。


在下文中一共展示了TdsParserStateObject.ReadInt32方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadSqlValueInternal


//.........这里部分代码省略.........
                    this.ReadSqlVariant(value, length, stateObj);
                    return;

                case 0x68:
                case 50:
                    value.Boolean = stateObj.ReadByte() != 0;
                    return;

                case 0x23:
                case 0x2e:
                case 0x2f:
                case 0x31:
                case 0x33:
                case 0x35:
                case 0x36:
                case 0x37:
                case 0x39:
                    return;

                case 0x24:
                {
                    byte[] buffer2 = new byte[length];
                    stateObj.ReadByteArray(buffer2, 0, length);
                    value.SqlGuid = new SqlGuid(buffer2, true);
                    return;
                }
                case 0x26:
                    if (length == 1)
                    {
                        break;
                    }
                    if (length == 2)
                    {
                        goto Label_00FE;
                    }
                    if (length != 4)
                    {
                        goto Label_011A;
                    }
                    goto Label_010C;

                case 0x30:
                    break;

                case 0x34:
                    goto Label_00FE;

                case 0x38:
                    goto Label_010C;

                case 0x3a:
                    goto Label_0187;

                case 0x3b:
                    goto Label_012D;

                case 60:
                    goto Label_014E;

                case 0x3d:
                    goto Label_01A2;

                case 0x3e:
                    goto Label_013B;

                default:
                    return;
            }
            value.Byte = stateObj.ReadByte();
            return;
        Label_00FE:
            value.Int16 = stateObj.ReadInt16();
            return;
        Label_010C:
            value.Int32 = stateObj.ReadInt32();
            return;
        Label_011A:
            value.Int64 = stateObj.ReadInt64();
            return;
        Label_012D:
            value.Single = stateObj.ReadSingle();
            return;
        Label_013B:
            value.Double = stateObj.ReadDouble();
            return;
        Label_014E:
            num4 = stateObj.ReadInt32();
            uint num3 = stateObj.ReadUInt32();
            long num2 = (num4 << 0x20) + num3;
            value.SetToMoney(num2);
            return;
        Label_0173:
            value.SetToMoney((long) stateObj.ReadInt32());
            return;
        Label_0187:
            value.SetToDateTime(stateObj.ReadUInt16(), stateObj.ReadUInt16() * SqlDateTime.SQLTicksPerMinute);
            return;
        Label_01A2:
            value.SetToDateTime(stateObj.ReadInt32(), (int) stateObj.ReadUInt32());
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:TdsParser.cs

示例2: Run


//.........这里部分代码省略.........
                    goto Label_06D5;
                }
                case 0xac:
                {
                    SqlReturnValue rec = this.ProcessReturnValue(tokenLength, stateObj);
                    if (cmdHandler != null)
                    {
                        cmdHandler.OnReturnValue(rec);
                    }
                    goto Label_06D5;
                }
                case 0xad:
                {
                    SqlLoginAck ack = this.ProcessLoginAck(stateObj);
                    this._connHandler.OnLoginAck(ack);
                    goto Label_06D5;
                }
                case 0x88:
                {
                    if (stateObj._cleanupAltMetaDataSetArray == null)
                    {
                        stateObj._cleanupAltMetaDataSetArray = new _SqlMetaDataSetCollection();
                    }
                    _SqlMetaDataSet altMetaDataSet = this.ProcessAltMetaData(tokenLength, stateObj);
                    stateObj._cleanupAltMetaDataSetArray.SetAltMetaData(altMetaDataSet);
                    if (dataStream != null)
                    {
                        dataStream.SetAltMetaDataSet(altMetaDataSet, 0x88 != stateObj.PeekByte());
                    }
                    goto Label_06D5;
                }
                case 0x79:
                {
                    int status = stateObj.ReadInt32();
                    if (cmdHandler != null)
                    {
                        cmdHandler.OnReturnStatus(status);
                    }
                    goto Label_06D5;
                }
                case 0x81:
                    if (tokenLength != 0xffff)
                    {
                        stateObj._cleanupMetaData = this.ProcessMetaData(tokenLength, stateObj);
                    }
                    else if (cmdHandler != null)
                    {
                        stateObj._cleanupMetaData = cmdHandler.MetaData;
                    }
                    if (dataStream != null)
                    {
                        byte num5 = stateObj.PeekByte();
                        dataStream.SetMetaData(stateObj._cleanupMetaData, (0xa4 == num5) || (0xa5 == num5));
                    }
                    else if (bulkCopyHandler != null)
                    {
                        bulkCopyHandler.SetMetaData(stateObj._cleanupMetaData);
                    }
                    goto Label_06D5;

                case 0xd1:
                    if (bulkCopyHandler == null)
                    {
                        if (RunBehavior.ReturnImmediately != (RunBehavior.ReturnImmediately & runBehavior))
                        {
                            this.SkipRow(stateObj._cleanupMetaData, stateObj);
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:67,代码来源:TdsParser.cs

示例3: ReadDecimalBits

 private int[] ReadDecimalBits(int length, TdsParserStateObject stateObj)
 {
     int num;
     int[] numArray = stateObj._decimalBits;
     if (numArray == null)
     {
         numArray = new int[4];
     }
     else
     {
         for (num = 0; num < numArray.Length; num++)
         {
             numArray[num] = 0;
         }
     }
     int num2 = length >> 2;
     for (num = 0; num < num2; num++)
     {
         numArray[num] = stateObj.ReadInt32();
     }
     return numArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:TdsParser.cs

示例4: ProcessError

 internal SqlError ProcessError(byte token, TdsParserStateObject stateObj)
 {
     int num2;
     int infoNumber = stateObj.ReadInt32();
     byte errorState = stateObj.ReadByte();
     byte errorClass = stateObj.ReadByte();
     int length = stateObj.ReadUInt16();
     string errorMessage = stateObj.ReadString(length);
     length = stateObj.ReadByte();
     if (length != 0)
     {
         stateObj.ReadString(length);
     }
     length = stateObj.ReadByte();
     string procedure = stateObj.ReadString(length);
     if (this._isYukon)
     {
         num2 = stateObj.ReadInt32();
     }
     else
     {
         num2 = stateObj.ReadUInt16();
         if ((this._state == TdsParserState.OpenNotLoggedIn) && (stateObj.PeekByte() == 0))
         {
             num2 = (num2 << 0x10) + stateObj.ReadUInt16();
         }
     }
     return new SqlError(infoNumber, errorState, errorClass, this._server, errorMessage, procedure, num2);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:TdsParser.cs

示例5: ProcessEnvChange


//.........这里部分代码省略.........
                            env.newCollation = this.ProcessCollation(stateObj);
                            this._defaultCollation = env.newCollation;
                            int codePage = this.GetCodePage(env.newCollation, stateObj);
                            if (codePage != this._defaultCodePage)
                            {
                                this._defaultCodePage = codePage;
                                this._defaultEncoding = Encoding.GetEncoding(this._defaultCodePage);
                            }
                            this._defaultLCID = env.newCollation.LCID;
                        }
                        env.oldLength = stateObj.ReadByte();
                        if (env.oldLength == 5)
                        {
                            env.oldCollation = this.ProcessCollation(stateObj);
                        }
                        env.length = (3 + env.newLength) + env.oldLength;
                        goto Label_03E0;

                    case 8:
                    case 9:
                    case 10:
                    case 11:
                    case 12:
                    case 0x11:
                        env.newLength = stateObj.ReadByte();
                        if (env.newLength <= 0)
                        {
                            goto Label_02B0;
                        }
                        env.newLongValue = stateObj.ReadInt64();
                        goto Label_02B8;

                    case 13:
                        this.ReadTwoStringFields(env, stateObj);
                        goto Label_03E0;

                    case 15:
                        env.newLength = stateObj.ReadInt32();
                        env.newBinValue = new byte[env.newLength];
                        stateObj.ReadByteArray(env.newBinValue, 0, env.newLength);
                        env.oldLength = stateObj.ReadByte();
                        env.length = 5 + env.newLength;
                        goto Label_03E0;

                    case 0x10:
                    case 0x12:
                        this.ReadTwoBinaryFields(env, stateObj);
                        goto Label_03E0;

                    case 0x13:
                        this.ReadTwoStringFields(env, stateObj);
                        goto Label_03E0;

                    case 20:
                    {
                        env.newLength = stateObj.ReadUInt16();
                        byte protocol = stateObj.ReadByte();
                        ushort port = stateObj.ReadUInt16();
                        ushort length = stateObj.ReadUInt16();
                        string servername = stateObj.ReadString(length);
                        env.newRoutingInfo = new RoutingInfo(protocol, port, servername);
                        num5 = stateObj.ReadUInt16();
                        num3 = 0;
                        goto Label_03C9;
                    }
                    default:
                        goto Label_03E0;
                }
                string s = env.newValue.Substring(2);
                this._defaultCodePage = int.Parse(s, NumberStyles.Integer, CultureInfo.InvariantCulture);
                this._defaultEncoding = Encoding.GetEncoding(this._defaultCodePage);
                goto Label_03E0;
            Label_02B0:
                env.newLongValue = 0L;
            Label_02B8:
                env.oldLength = stateObj.ReadByte();
                if (env.oldLength > 0)
                {
                    env.oldLongValue = stateObj.ReadInt64();
                }
                else
                {
                    env.oldLongValue = 0L;
                }
                env.length = (3 + env.newLength) + env.oldLength;
                goto Label_03E0;
            Label_03BC:
                stateObj.ReadByte();
                num3++;
            Label_03C9:
                if (num3 < num5)
                {
                    goto Label_03BC;
                }
                env.length = (env.newLength + num5) + 5;
            Label_03E0:
                num4 += env.length;
            }
            return changeArray;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:101,代码来源:TdsParser.cs

示例6: ProcessDone

 private void ProcessDone(SqlCommand cmd, SqlDataReader reader, ref RunBehavior run, TdsParserStateObject stateObj)
 {
     int num2;
     ushort status = stateObj.ReadUInt16();
     ushort curCmd = stateObj.ReadUInt16();
     if (this._isYukon)
     {
         num2 = (int) stateObj.ReadInt64();
     }
     else
     {
         num2 = stateObj.ReadInt32();
         if (((this._state == TdsParserState.OpenNotLoggedIn) && (stateObj._inBytesRead > stateObj._inBytesUsed)) && (stateObj.PeekByte() == 0))
         {
             num2 = stateObj.ReadInt32();
         }
     }
     if (0x20 == (status & 0x20))
     {
         stateObj._attentionReceived = true;
     }
     if ((cmd != null) && (0x10 == (status & 0x10)))
     {
         if (curCmd != 0xc1)
         {
             cmd.InternalRecordsAffected = num2;
         }
         if (stateObj._receivedColMetaData || (curCmd != 0xc1))
         {
             cmd.OnStatementCompleted(num2);
         }
     }
     stateObj._receivedColMetaData = false;
     if (((2 == (2 & status)) && (this._errors == null)) && (!stateObj._errorTokenReceived && (RunBehavior.Clean != (RunBehavior.Clean & run))))
     {
         this.Errors.Add(new SqlError(0, 0, 11, this._server, SQLMessage.SevereError(), "", 0));
         if ((reader != null) && !reader.IsInitialized)
         {
             run = RunBehavior.UntilDone;
         }
     }
     if ((0x100 == (0x100 & status)) && (RunBehavior.Clean != (RunBehavior.Clean & run)))
     {
         this.Errors.Add(new SqlError(0, 0, 20, this._server, SQLMessage.SevereError(), "", 0));
         if ((reader != null) && !reader.IsInitialized)
         {
             run = RunBehavior.UntilDone;
         }
     }
     this.ProcessSqlStatistics(curCmd, status, num2);
     if (1 != (status & 1))
     {
         stateObj._errorTokenReceived = false;
         if (stateObj._inBytesUsed >= stateObj._inBytesRead)
         {
             stateObj._pendingData = false;
         }
     }
     if (!stateObj._pendingData && stateObj._hasOpenResult)
     {
         stateObj.DecrementOpenResultCount();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:63,代码来源:TdsParser.cs

示例7: GetTokenLength

        internal int GetTokenLength(byte token, TdsParserStateObject stateObj)
        {
            if (this._isYukon)
            {
                if (token == 240)
                {
                    return -1;
                }
                if (token == 0xac)
                {
                    return -1;
                }
                if (token == 0xf1)
                {
                    return stateObj.ReadUInt16();
                }
            }
            switch ((token & 0x30))
            {
                case 0x20:
                case 0:
                    if ((token & 0x80) != 0)
                    {
                        return stateObj.ReadUInt16();
                    }
                    if ((token & 12) == 0)
                    {
                        return stateObj.ReadInt32();
                    }
                    return stateObj.ReadByte();

                case 0x30:
                    return ((((int) 1) << ((token & 12) >> 2)) & 0xff);

                case 0x10:
                    return 0;
            }
            return 0;
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:39,代码来源:TdsParser.cs


注:本文中的System.Data.SqlClient.TdsParserStateObject.ReadInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。