using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO;namespace BS
{
    class EquipmentAll
    {
    }
    /// <summary>
    /// 获取T_EquipmentAll表中的记录
/// </summary>
/// <param name="">无参数</param>
/// <returns>DataSet</returns>
static public DataSet EquipmentGetDataSet("d")
{
string selectSql="select * from T_EquipmentAll ";
return DAOHelper.getDataSet(selectSql);
}
    
   
}
错误为:
错误 1 应输入 class、delegate、enum、interface 或 struct C:\Inetpub\wwwroot\Sub\BS\EquipmentAll.cs 18 16 BS

解决方案 »

  1.   

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    using DAO;namespace BS
    {
        class EquipmentAll
        {
        }
        /// <summary>
        /// 获取T_EquipmentAll表中的记录
    /// </summary>
    /// <param name="">无参数</param>
    /// <returns>DataSet</returns>
     public static DataSet EquipmentGetDataSet()
    {
    string selectSql="select * from T_EquipmentAll ";
    return DAOHelper.getDataSet(selectSql);
    }
        
       
    }
      

  2.   

    static public DataSet EquipmentGetDataSet("d")  这是个什么呢? 写成方法
      

  3.   

    static public DataSet EquipmentGetDataSet()//16行所在,我去掉参数,错误依旧,同时DataSet  这个颜色不是绿色显示(v 2005),下有红色波浪线提示.
      

  4.   

    static public DataSet EquipmentGetDataSet("d")  这是个什么呢? 写成方法
    //
    上面这个就是我的方法EquipmentGetDataSet() 而"d"是我随便写的,没有用这个参数,而返回类型是DataSet
      

  5.   

    static public DataSet EquipmentGetDataSet()
    你这个方法是什么方法
    都不在类里面!
    怎么写出来的?
      

  6.   

    kellynt() ( ) 信誉:100    Blog   加为好友  2007-06-27 15:08:56  得分: 0  
     
     
       将你的方法放在类里面
      
     
    ---------------------------------
    谢谢,就是这个问题
    之前我还着重检查了一下是不是这个错,但是自己没有反应过来,把这个明显错误给忽略了.
    这个错已经是第二次犯了.太粗心了.
    谢谢啦
      

  7.   

    static public DataSet EquipmentGetDataSet("d")
    {
    string selectSql="select * from T_EquipmentAll ";
    return DAOHelper.getDataSet(selectSql);
    }改为
    static public DataSet EquipmentGetDataSet(string selectSql)
    {
    return DAOHelper.getDataSet(selectSql);
    }