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

 

 ·语法错误    »显示摘要«
    摘要: /****************************************************** * 名 sp_category_add * * 功 能:增加合同类别信息 * * 作 者:heidi * * 返 回 值: * 0 -- 操作成功 ******************************************************/ create p......
 ·熟悉苹果机的请进    »显示摘要«
    摘要: 哪位大虾用过苹果机配置php运行环境? ......


做不下去了,各位

Imports   System.Data.OleDb  
  Public   Class   Test  
          Private   p_empid   As   Integer  
          Private   P_job   As   String  
          Property   empid()   As   Integer  
                  Get  
                          Return   p_empid  
                  End   Get  
                  Set(ByVal   Value   As   Integer)  
                          p_empid   =   Value  
                  End   Set  
          End   Property  
          Property   job()   As   String  
                  Get  
                          Return   P_job  
                  End   Get  
                  Set(ByVal   Value   As   String)  
                          P_job   =   Value  
                  End   Set  
          End   Property  
  End   Class  
  Public   Class   Testdb  
          Public   Function   dbcon()   As   Test  
                  Dim   conn   As   New   OleDbConnection()  
                  Dim   cmd   As   OleDbCommand  
                  conn.ConnectionString   =   "Provider=OraOLEDB.Oracle;User     D=scott;Password=tiger;Data   Source=aca013"  
                  cmd   =   conn.CreateCommand  
                  cmd.CommandText   =   CommandType.Text  
                  cmd.CommandText   =   "select   *   from   emp"  
                  cmd.Connection   =   conn  
                  conn.Open()  
                  Dim   reader   As   OleDbDataReader  
                  reader   =   cmd.ExecuteReader  
                  Dim   arrlist   As   New   ArrayList()  
                  Dim   testproperty   As   Test  
                  While   reader.Read  
                          testproperty   =   New   Test()  
                          testproperty.empid   =   Decimal.ToInt32(reader.GetDecimal(0))  
                          testproperty.job   =   reader.GetString(1)  
                          arrlist.Add(testproperty)  
                  End   While  
                  Return   (Test())arrlist.ToArray(typeof(Test))  
          End   Function  
  End   Class  
  上面的代码想实现从表emp中取出两个字段值,  
  dbcon()   我想返回数组类型,其元素是Test,请问   Public   Function   dbcon()   As   Test   和   Return   这里怎么写啊?  
 

NO.1   作者: yuxi007

Public   Function   dbcon()   As   Test()  
   
  在dbcon()函数中定义一个Test()并创建或引用Test的实例,之后   Return   你定义的变量即可  
   
  比如:  
  dim   a(5)   as   test  
  a(0)=new   test  
  a(0).。。。=。。。  
  ......  
   
  return   a  
   
  即可

NO.2   作者: raul1122

Public   Function   dbcon()   As   Test()  
   
  在dbcon()函数中定义一个Test()并创建或引用Test的实例,之后   Return   你定义的变量即可  
   
  比如:  
  dim   a(5)   as   test  
  a(0)=new   test  
  a(0).。。。=。。。  
  ......  
   
  return   a


    摘要: 我想给超链接加个提示,那个提示可以换行 ,不知怎么写 a href="showcont.asp?titles=<%=rs("stitle")%>&username=<%=rs("suid")%>"target=boardright title=asf"<br>"fdf......
» 本期热门文章:

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