日期:2014-05-19  浏览次数:20736 次

写了一个类如下,但是保存报错,什么原因呢
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


------解决方案--------------------
将你的方法放在类里面
------解决方案--------------------
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);
}