English 中文(简体)
在其他情况下,数据表没有记录。
原标题:Dataview does not contains record in other event.
  • 时间:2011-11-11 11:22:06
  •  标签:
  • c#
  • asp.net

我在全球宣言一节中界定了全球数据概览。 现在,用一种方法将另一个数据概览的价值分配给这一全球定义的数据概览。 现在,我正在将这一全球定义的数据概览作为另一种方法。 但是,我没有看到首先界定的记录。 我需要这样做。 如何做到这一点?

public partial class Properties : System.Web.UI.Page
{
    //Declaration of Dataview :
     DataView dtViewLink = new DataView();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    // define in this method 
    protected void myMethod(object sender, EventArgs e)
    {
        dtViewLink = null;
        dtViewLink = dvEmployee;       //dvEmployee is other Dataview that has two records.
    }
    // i am using it here
   protected void ddlSortSortBy_SelectedIndexChanged(object sender, EventArgs e)
   {
       if (dtViewLink.Count > 0)
       {
                   dtViewLink.Sort = "" + strName + " Asc";

       }
   }
}

这一例子将表明我必须做些什么。

问题回答

假设你在使用页数不同或不同阶段使用这些方法,那么数据概览的范围就会消失。 你们应设法将这个物体储存在海滩上,以便用于平整页。

该法典:

dtViewLink = null;
dtViewLink = dvEmployee;

页: 1

dvEmployee, 是否有任何记录,或者在您进入dlSortBy_S selected IndexChanged之前,在下列退席上是否无效?

人们询问,你是否在同一页的生命周期中,这两个概念是不同的,由于网络形式是无国籍的,如果你想在后面/生活周期和其他方法中再次使用,你就应当坚持自己的数据。

页: 1 数据活动和从“Load”网页上引来,或者在“观点”、“会议”或“Cache”中,如果这种数据只用于这一网页,而且其数量非常小(语国家),那么,在目前用户会议(Session)或任何地方,以及网络应用(Cache)的每个人,数据都会持续。

use 

static DataView dtViewLink ; // globally




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签