using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using et.SqlDAL;
using System.Data.SqlClient;
namespace et.BLL
{
    public class Goods
    {
        public DataTable GetHotProductList()
        {//获取热点商品列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 10 content,goodsid from goods order by downcount desc";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt=sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetNewTopProductList()
        {//获取最新商品列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 10 content,buysell,goodsid from goods order by protime desc";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetFangwuList()
        {//获取房屋信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,price,goodsid from goods where goodtypeid=1";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetNetWorkList()
        {//获取电脑网络信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=2";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetJiaoTongList()
        {//获取交通工具信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=3";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetJiaDianList()
        {//获取家电信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=4";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable GetShouCangList()
        {//获取收藏信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=5";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }
        public DataTable GetLiPList()
        {//获取礼品信息列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select top 5 content,buysell,goodsid,price from goods where goodtypeid=6";
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }        public DataTable ProductById(int gid)//这个方法在调用时无法调用没有智能提示????其他方法都可以的为什么啊?????
        {//根据编号获取产品详细列表
            DataTable dt = new DataTable();
            SqlDAL.SqlHelper sqlhelp = new SqlHelper();
            string strSql = "select *from goods where goodsid=" + gid;
            SqlConnection conn = new SqlConnection(sqlhelp.strConn);
            dt = sqlhelp.DisPLayList_Dt(strSql, conn);
            return dt;
        }

      
       
    }
}//调用的类
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using et.BLL;
public partial class Details : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string strgoodsid=Request.QueryString["goodsid"].ToString();
         
        Goods goods = new Goods();
        goods.GetLiPList();//没问题
        goods.ProductById(2);//报错
/*报错错误 1 “et.BLL.Goods”并不包含“ProductById”的定义 E:\study\computer\asp.net project\etPro\Details.aspx.cs 18 15 E:\...\etPro\
*/
    }
}

解决方案 »

  1.   

     public DataTable ProductById(int gid)//这个方法在调用时无法调用没有智能提示????其他方法都可以的为什么啊????? 
            {//根据编号获取产品详细列表 
                DataTable dt = new DataTable(); 
                SqlDAL.SqlHelper sqlhelp = new SqlHelper(); 
                string strSql = "select *from goods where goodsid=" + gid.ToString(); 
                SqlConnection conn = new SqlConnection(sqlhelp.strConn); 
                dt = sqlhelp.DisPLayList_Dt(strSql, conn); 
                return dt; 
            } 重新编译生成 dll
      

  2.   

    就保留 ProductById 方法,其他都注释,然后编译。 看看
      

  3.   

    把负责调用那个工程里面的et.BLL(是原来的旧名字) 引用删除掉 重新引用et.BLL
      

  4.   

    朋友,面向对象有一个特性,叫做[size=16px][/重载size]……