文件和类后面的代码 [英] code behind file and the class

查看:65
本文介绍了文件和类后面的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是课程

public class Transition
{
// default constructor   
    public Transition()
    {
        if (StageId == 0)
        {
_queryString = "SELECT PHASE, FROM_STAGE, TO_STAGE, END_REASON FROM     Dbase WHERE PHASE='Complaint'";
        }
        else if (StageId > 0)
        {
_queryString = string.Format("SELECT PHASE, FROM_STAGE, TO_STAGE, END_REASON FROM Dbase WHERE PHASE='Complaint' AND STAGE_FROM_ID={0}",StageId);
               
        }
     }
    
// getters and setters for quesry string
public string QueryString
        { 
            get { return _queryString; }
            set { _queryString = value;}
        }
// getters and setters for stage id
public int StageId
        {
    private get { return _stageId; }
            set { _stageId = value; }
        }
    
 
// The variables  
private string _queryString;
private int    _stageId;
private string _fillDropdownList;     

// This is where I call the class.

ublic partial class GridGroupControl : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
        
        Transition trns = new Transition();
        trns.StageId =1672;
        SqlDataSource1.SelectCommand = trns.QueryString;

    }



昨天工作正常,但是今天当我在codebehisnd文件中更改阶段ID时,它仍然不会带来旧结果.我所做的只是带来旧结果.就像它的缓存一样.我不知道为什么?



It worked fine yesterday but today when I change the stage id in codebehisnd file it still brings the old result no change.what ever I do it just bring the old results.loks like its caching. I don''t know why?

推荐答案

如果您可以直接访问有问题的数据库,只需在Management Studio中打开它(如果它是MSSQL)并运行查询直接在那里.如果其中显示的数据与您显示的数据相同,则您的应用程序中没有问题.如果数据不同,请遵循d @ anish的建议并执行干净的重建/清除临时ASP.Net文件.
If you have direct access to the database in question, just open it in Management Studio(if it is MSSQL) and run the query directly there. If the data that comes up in there is the same as what you display, then you haven''t got an issue in your application. If the data is different, take d@anish''s advice and perform a clean an rebuild/clear Temporary ASP.Net files.


清理项目或删除您的项目中的"bin"文件夹项目文件夹并全部重建
Clean your project or delete "bin" folder in your project folder and rebuild all


这篇关于文件和类后面的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆