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


C# SqlDataReader.NextResult方法代码示例

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


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

示例1: BuildClientOrder

        public static YellowstonePathology.Business.ClientOrder.Model.ClientOrder BuildClientOrder(SqlDataReader dr)
        {
            YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = null;
            Nullable<int> panelSetId = null;
            while (dr.Read())
            {
                if (dr["PanelSetId"] != DBNull.Value)
                {
                    panelSetId = Convert.ToInt32(dr["PanelSetId"].ToString());
                }
            }

            clientOrder = YellowstonePathology.Business.ClientOrder.Model.ClientOrderFactory.GetClientOrder(panelSetId);
            dr.NextResult();

            while (dr.Read())
            {
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrder, dr);
                propertyWriter.WriteProperties();
            }

            dr.NextResult();
            while (dr.Read())
            {
                YellowstonePathology.Business.Client.Model.ClientLocation clientLocation = new YellowstonePathology.Business.Client.Model.ClientLocation();
                YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter(clientLocation, dr);
                propertyWriter.WriteProperties();
                clientOrder.ClientLocation = clientLocation;
            }

            return clientOrder;
        }
开发者ID:ericramses,项目名称:YPILIS,代码行数:32,代码来源:ClientOrderGateway.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        conn = new SqlConnection(ConfigurationManager.AppSettings["strConLocal"]);
        comm = new SqlCommand("InterventionPlan_Select", conn);
        comm.CommandType = CommandType.StoredProcedure;
        comm.Parameters.AddWithValue("@PortTypeID", _PortTypeID.ToString());
        comm.Parameters.AddWithValue("@PortfolioID", "0");
        comm.Parameters.AddWithValue("@InterventionPlanID", _PlanID.ToString());
        conn.Open();
        drData = comm.ExecuteReader();

        rptDelivery.DataSource = drData;
        rptDelivery.DataBind();
        drData.NextResult();

        rptStrategy.DataSource = drData;
        rptStrategy.DataBind();
        drData.NextResult();

        rptPerson.DataSource = drData;
        rptPerson.DataBind();
        drData.NextResult();

        rptUpdate.DataSource = drData;
        rptUpdate.DataBind();
        drData.NextResult();
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:27,代码来源:InterventionPlanDetail.ascx.cs

示例3: isNameExisted

 public int isNameExisted(string uName)
 {
     try
     {
         SqlInit();
         cmd.CommandText = "SELECT * FROM users where email='" + uName;
         dr = cmd.ExecuteReader();
         if(dr.NextResult())
         {
             if(dr.GetString(1)==uName)
             {
                 SqlExit();
                 //email existed
                 return 1;
             }
         }
     }
     catch (SqlException e)
     {
         //error
         SqlExit();
         return 666;
     }
     SqlExit();
     //email can use
     return 0;
 }
开发者ID:Tedstack,项目名称:MicroZone,代码行数:27,代码来源:Supports.cs

示例4: isEmailExisted

 public int isEmailExisted(string eMail)
 {
     try
     {
         SqlInit();
         cmd.CommandText = "SELECT * FROM users where email='" + eMail;
         dr = cmd.ExecuteReader();
         if (dr.NextResult())
         {
             if (dr.GetString(2) == eMail)
             {
                 SqlExit();
                 //name existed
                 return 1;
             }
         }
     }
     catch (SqlException e)
     {
         //error
         SqlExit();
         return 666;
     }
     SqlExit();
     //name can use
     return 0;
 }
开发者ID:Tedstack,项目名称:MicroZone,代码行数:27,代码来源:Supports.cs

示例5: ProcessSqlResult

 protected override Exception ProcessSqlResult(SqlDataReader reader)
 {
     Exception nextResultSet = StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader);
     if (nextResultSet == null)
     {
         reader.NextResult();
         List<IDictionary<XName, object>> parameters = new List<IDictionary<XName, object>>();
         if (reader.Read())
         {
             do
             {
                 IDictionary<XName, object> item = new Dictionary<XName, object>();
                 item.Add(WorkflowServiceNamespace.SiteName, reader.GetString(0));
                 item.Add(WorkflowServiceNamespace.RelativeApplicationPath, reader.GetString(1));
                 item.Add(WorkflowServiceNamespace.RelativeServicePath, reader.GetString(2));
                 parameters.Add(item);
             }
             while (reader.Read());
         }
         else
         {
             base.Store.UpdateEventStatus(false, InstancePersistenceEvent<HasActivatableWorkflowEvent>.Value);
             base.StoreLock.InstanceDetectionTask.ResetTimer(false);
         }
         base.InstancePersistenceContext.QueriedInstanceStore(new ActivatableWorkflowsQueryResult(parameters));
     }
     return nextResultSet;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:QueryActivatableWorkflowAsyncResult.cs

示例6: SendAllRecordsToGraphite

 private void SendAllRecordsToGraphite(string path, SqlDataReader myReader)
 {
     do
     {
         this.SendRecordToGraphite(path, myReader);
     }
     while (myReader.NextResult());
 }
开发者ID:matthewskelton,项目名称:SqlToGraphite,代码行数:8,代码来源:SqlGetter.cs

示例7: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        conn = new SqlConnection(ConfigurationManager.AppSettings["strConLocal"]);
        comm = new SqlCommand("InterventionPlan_Select", conn);
        comm.CommandType = CommandType.StoredProcedure;
        comm.Parameters.AddWithValue("@PortTypeID", _PortTypeID.ToString());
        comm.Parameters.AddWithValue("@PortfolioID", "0");
        comm.Parameters.AddWithValue("@InterventionPlanID", _PlanID.ToString());
        conn.Open();
        drData = comm.ExecuteReader();

        rptDelivery.DataSource = drData;
        rptDelivery.DataBind();
        drData.NextResult();

        rptStrategy.DataSource = drData;
        rptStrategy.DataBind();
        drData.NextResult();

        rptPerson.DataSource = drData;
        rptPerson.DataBind();
        drData.NextResult();

        rptUpdate.DataSource = drData;
        rptUpdate.DataBind();
        drData.NextResult();

        drData.Read();
        if (drData["InterventionContAreaText"].ToString() != "")
            strContentArea = drData["InterventionContAreaName_EN"].ToString() + ": " + drData["InterventionContAreaText"].ToString();
        else
            strContentArea = drData["InterventionContAreaName_EN"].ToString();

        if (Convert.ToBoolean(drData["IsDiscontinued"]))
            strStatus = "Discontinued";
        else
            if (drData["AEDate"].ToString() != "") strStatus = "Completed";
            else strStatus = "Active";

        if (drData["InterventionInstrText"].ToString() != "")
            strInstrument = drData["InterventionInstrName_EN"].ToString() + ": " + drData["InterventionInstrText"].ToString();
        else
            strInstrument = drData["InterventionInstrName_EN"].ToString();
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:44,代码来源:ReportsInterventionPlanDetail.ascx.cs

示例8: CheckRemainingResultSetForErrors

 public static Exception CheckRemainingResultSetForErrors(XName commandName, SqlDataReader reader)
 {
     Exception nextResultSet = null;
     do
     {
         nextResultSet = GetNextResultSet(commandName, reader);
     }
     while ((nextResultSet == null) && reader.NextResult());
     return nextResultSet;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:StoreUtilities.cs

示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        conn = new SqlConnection(ConfigurationManager.AppSettings["strConLocal"]);
        comm = new SqlCommand("InterventionPlanSchool_Select", conn);
        comm.CommandType = CommandType.StoredProcedure;
        comm.Parameters.AddWithValue("@InterventionPlanID", _PlanID.ToString());
        conn.Open();
        drData = comm.ExecuteReader();

        drData.NextResult();

        rptCurricular.DataSource = drData;
        rptCurricular.DataBind();
        drData.NextResult();

        rptBehavioral.DataSource = drData;
        rptBehavioral.DataBind();
        drData.NextResult();
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:19,代码来源:InterPlanSchoolWideStuDetail.ascx.cs

示例10: AdvanceToNextRow

 private static bool AdvanceToNextRow(SqlDataReader reader)
 {
     do
     {
         if (reader.Read())
         {
             return true;
         }
     }
     while (reader.NextResult());
     return false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:SqlStream.cs

示例11: CheckRemainingResultSetForErrors

        public static Exception CheckRemainingResultSetForErrors(XName commandName, SqlDataReader reader)
        {
            Exception returnException = null;

            do
            {
                returnException = StoreUtilities.GetNextResultSet(commandName, reader);
            }
            while (returnException == null && reader.NextResult());

            return returnException;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:StoreUtilities.cs

示例12: CreatePostsFromReader

        public static Collection<Post> CreatePostsFromReader(SqlDataReader reader)
        {
            // First result set is the postcategories. 
            Dictionary<int, Category> postcats = new Dictionary<int, Category>();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    // Oops - key can't be PostId as key has to be unique. Need to use a different collection..
                    // .. for now, make a hash of the post and category IDs.
                    int categoryId = Convert.ToInt32(reader["categoryId"]);
                    int postHash = (Convert.ToInt32(reader["PostId"]) * 10000) + categoryId;
                    postcats.Add(postHash, new Category(categoryId, Convert.ToString(reader["Name"]), Convert.ToString(reader["Slug"])));
                }
            }

            // Second resultset is the post(s)
            reader.NextResult();

            Collection<Post> postlist = new Collection<Post>();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    Post p = new Post();

                    p.Id = Convert.ToInt32(reader["Id"]);
                    p.Title = Convert.ToString(reader["Title"]);
                    p.Postdate = Convert.ToDateTime(reader["PostDate"]);
                    p.Body = Convert.ToString(reader["Body"]);
                    p.Slug = Convert.ToString(reader["Slug"]);
                    p.CommentCount = Convert.ToInt32(reader["CommentCount"]);
                    p.Published = Convert.ToBoolean(reader["Published"]);
                    p.Categories = new Collection<Category>();

                    // .. then the categories.
                    IEnumerable<Category> cats =
                        from entry in postcats
                        where ((entry.Key / 10000) == p.Id)
                        select entry.Value;

                    foreach (Category cat in cats)
                    {
                        p.Categories.Add(cat);
                    }

                    postlist.Add(p);
                }
            }

            return postlist;
        }
开发者ID:tmzu,项目名称:keymapper,代码行数:52,代码来源:SQLDataMap.cs

示例13: BuildClientOrderCollection

        public static void BuildClientOrderCollection(SqlDataReader dr, YellowstonePathology.Business.ClientOrder.Model.ClientOrderCollection clientOrderCollection)
        {
            int clientOrderIdCount = 0;
            while (dr.Read())
            {
                if (dr["ClientOrderIdCount"] != DBNull.Value)
                {
                    clientOrderIdCount = Convert.ToInt32(dr["ClientOrderIdCount"].ToString());
                }
            }

            for (int i = 0; i < clientOrderIdCount; i++)
            {
                dr.NextResult();
                YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = BuildClientOrder(dr);
                dr.NextResult();
                BuildClientOrderDetailCollection(clientOrder.ClientOrderDetailCollection, dr);

                if (clientOrder.ClientOrderId != null)
                {
                    clientOrderCollection.Add(clientOrder);
                }
            }
        }
开发者ID:ericramses,项目名称:YPILIS,代码行数:24,代码来源:ClientOrderGateway.cs

示例14: ConvertDataReaderToDataSet

        /// <summary>
        /// [static] PAB.Data.Utils.DataReaderConverters.ConvertDataReaderToDataSet:
        /// Converts one or more resultsets returned in a SqlDataReader to a DataSet
        /// </summary>
        /// <param name="reader">SqlDataReader</param>
        /// <returns>System.Data.DataSet</returns>
        public static DataSet ConvertDataReaderToDataSet(SqlDataReader reader)
        {
            DataSet dataSet = new DataSet();
            do
            {
                // Create new data table
                DataTable schemaTable = reader.GetSchemaTable();
                DataTable dataTable = new DataTable();

                if ( schemaTable != null )
                {
                    for ( int i = 0; i < schemaTable.Rows.Count; i++ )
                    {
                        DataRow dataRow = schemaTable.Rows[ i ];
                        // Create a column name that is unique in the data table
                        string columnName = ( string )dataRow[ "ColumnName" ];
                        // Add the column definition to the data table
                        DataColumn column = new DataColumn( columnName, ( Type )dataRow[ "DataType" ] );
                        dataTable.Columns.Add( column );
                    }

                    dataSet.Tables.Add( dataTable );

                    while ( reader.Read() )
                    {
                        DataRow dataRow = dataTable.NewRow();

                        for ( int i = 0; i < reader.FieldCount; i++ )
                            dataRow[ i ] = reader.GetValue( i );

                        dataTable.Rows.Add( dataRow );
                    }
                }
                else
                {
                    // No records returned

                    DataColumn column = new DataColumn("RowsAffected");
                    dataTable.Columns.Add(column);
                    dataSet.Tables.Add( dataTable );
                    DataRow dataRow = dataTable.NewRow();
                    dataRow[0] = reader.RecordsAffected;
                    dataTable.Rows.Add( dataRow );
                }
            }
            while ( reader.NextResult() );
            return dataSet;
        }
开发者ID:hoangtung56pm,项目名称:KPINew,代码行数:54,代码来源:DataReaderConverters.cs

示例15: ProcessSqlResult

 protected override Exception ProcessSqlResult(SqlDataReader reader)
 {
     Exception nextResultSet = StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader);
     if (nextResultSet == null)
     {
         reader.NextResult();
         if (reader.Read())
         {
             base.Store.UpdateEventStatus(true, InstancePersistenceEvent<HasActivatableWorkflowEvent>.Value);
             return nextResultSet;
         }
         base.Store.UpdateEventStatus(false, InstancePersistenceEvent<HasActivatableWorkflowEvent>.Value);
         base.StoreLock.InstanceDetectionTask.ResetTimer(false);
     }
     return nextResultSet;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:DetectActivatableWorkflowsAsyncResult.cs


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