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


C# SqlCommand.OnReturnStatus方法代码示例

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


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

示例1: TryRun


//.........这里部分代码省略.........
                            if (null != bulkCopyHandler)
                            {
                                if (!TryProcessRow(stateObj._cleanupMetaData, bulkCopyHandler.CreateRowBuffer(), bulkCopyHandler.CreateIndexMap(), stateObj))
                                {
                                    return false;
                                }
                            }
                            else if (RunBehavior.ReturnImmediately != (RunBehavior.ReturnImmediately & runBehavior))
                            {
                                if (!TrySkipRow(stateObj._cleanupMetaData, stateObj))
                                { // skip rows
                                    return false;
                                }
                            }
                            else
                            {
                                dataReady = true;
                            }

                            if (_statistics != null)
                            {
                                _statistics.WaitForDoneAfterRow = true;
                            }
                            break;
                        }
                    case TdsEnums.SQLRETURNSTATUS:
                        int status;
                        if (!stateObj.TryReadInt32(out status))
                        {
                            return false;
                        }
                        if (cmdHandler != null)
                        {
                            cmdHandler.OnReturnStatus(status);
                        }
                        break;
                    case TdsEnums.SQLRETURNVALUE:
                        {
                            SqlReturnValue returnValue;
                            if (!TryProcessReturnValue(tokenLength, stateObj, out returnValue))
                            {
                                return false;
                            }
                            if (cmdHandler != null)
                            {
                                cmdHandler.OnReturnValue(returnValue);
                            }
                            break;
                        }
                    case TdsEnums.SQLSSPI:
                        {
                            // token length is length of SSPI data - call ProcessSSPI with it

                            Debug.Assert(stateObj._syncOverAsync, "ProcessSSPI does not support retry, do not attempt asynchronously");
                            stateObj._syncOverAsync = true;

                            ProcessSSPI(tokenLength);
                            break;
                        }
                    case TdsEnums.SQLTABNAME:
                        {
                            {
                                if (!stateObj.TrySkipBytes(tokenLength))
                                {
                                    return false;
                                }
开发者ID:nnyamhon,项目名称:corefx,代码行数:67,代码来源:TdsParser.cs

示例2: Run


//.........这里部分代码省略.........
                {
                    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);
                        }
                        break;
                    }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:67,代码来源:TdsParser.cs


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