当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: os:windows server 2003/tomcat5.028 配置如下: 用户变量: java_home:c:\j2sdk1.4.2_06\jre 系统变量:classpath: .;c:\j2sdk1.4.2_06\lib\dt.jar; c:\j2sdk1.4.2_06\lib\tools.jar; c:\j2sdk1.4.2_06\lib\netcomponents.jar;......
 ·#define sig    »显示摘要«
    摘要: void(*signal(int sig,void(*disp)(int)))(int); #define sig_ign (void(*)()) 1 void(*)()定义了一个指向函数的空指针,这个空指针后面加个常数又会是怎么回事?是函数的参数?sig_ign又可做为参数传入signal中,真是被搞得晕部转向,请大家帮忙解释一下。 ......


关于循环给控件负值错误

for(int   i=0;i<=2;i++)  
  {  
   
  int   tp=i+1;  
    OleDbCommand   objCommand   =   new   OleDbCommand("select   *   from   文字   where   位置=index"+   tp   +""   ,   objConnection);  
  objConnection.Open();  
    OleDbDataReader   objDataReader=objCommand.ExecuteReader();  
    if(objDataReader.Read())  
    {  
   
      string   lcID="lable"+i*3+1;  
            foreach(WebControl   webControl   in   this.Controls)  
          {  
                  if(webControl   is   Label   &&   webControl.ID   ==   lcID)  
                  {  
                              webControl.Text   =   Convert.ToString(objDataReader["标题"]);  
                  }  
        }  
   
     
    }  
   
    }  
   
   
   
  错误提示:  
   
  Compilation   Error    
  Description:   An   error   occurred   during   the   compilation   of   a   resource   required   to   service   this   request.   Please   review   the   following   specific   error   details   and   modify   your   source   code   appropriately.    
   
  Compiler   Error   Message:   CS0117:   System.Web.UI.WebControls.WebControl   does   not   contain   a   definition   for   Text  
   
  Source   Error:  
   
     
   
  Line   47:                   if(webControl   is   Label   &&   webControl.ID   ==   lcID)  
  Line   48:                   {  
  Line   49:                       webControl.Text   =   Convert.ToString(objDataReader["标题"]);   **错误行  
  Line   50:                   }  
  Line   51:         }  
     
 

NO.1   作者: birdxxxx

if(webControl   is   Label   &&   webControl.ID   ==   lcID)  
  {  
                     

if(webControl   is   Label   &&   webControl.ID   ==   lcID)  
  {  
                      ((Label)webControl).Text   =   Convert.ToString(objDataReader["标题"]);   **错误行  
  }

NO.3   作者: hchxxzx

错误实际上在这一句  
  foreach(WebControl   webControl   in   this.Controls)  
  在asp.net中,当前的窗体,实际上并非即为form,this.Controls实际上包含三个对象:form之前的页面头部对象,form对象,form对象之后的页面底部。  
  所以上述语句应该改为:  
  foreach(WebControl   webControl   in   this.Controls[1].Controls)


    摘要: 90度、180度、270度三种标准贴图,要求是gdi编程方式! ......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE