• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Intellisense not finding my method

Here's my class

     public class GetListURLs
    {
 
       private string _ConnString;

        public GetListURLs(string connection)
        {
            this._ConnString = connection;
        }

        public DataSet GetList()
        {
            DataSet URLs = new DataSet();
            SqlConnection Conn = new SqlConnection(this._ConnString);
            try
            {

                SqlCommand GetURLsCommand = new SqlCommand("GetURLs", Conn);
                GetURLsCommand.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(GetURLsCommand);
                da.Fill(URLs);
               
                return URLs;
               
            }
            catch
            {
                return null;
            }
            finally
            {
                Conn.Close();
            }
        }
    }
}

In my aspx code-behind, I can't get to my GetURLs() using Intellisense.

I type DataSet urls = GetListURLs.   in my page_load and the only options I get after the dot are "Equals" or  "ReferenceEquals"

I have added my Class Library dll into my web site and the using namespace is working for the class library.  It is recognizing my class GetListURLs, just not my GetURLs() and I'm not sure why.
0
dba123
Asked:
dba123
  • 6
  • 3
1 Solution
 
paulb1989Commented:
Did you create an instance of your class in order to access the methods?

For example:

GetListURLs instance = new GetListURLs("Value");
DataSet whatever = instance.GetList();
0
 
dba123Author Commented:
this is what I did in the page_load of my code-behind:

        GetListURLs geturls = new GetListURLs(System.Configuration.ConfigurationManager.AppSettings["MyConn"]);
        DataSet urls = GetList();

        VPPURLList.DataSource = urls;
        VPPURLList.DataBind();
0
 
dba123Author Commented:
I tried this now, but it still doesn't give GetList() in the Intellisence:

        GetListURLs geturls = new GetListURLs(System.Configuration.ConfigurationManager.AppSettings["JDVConn"]);
        DataSet urls = geturls.

        VPPURLList.DataSource = urls;
        VPPURLList.DataBind();

The options I get after geturls.  are now "Equals", "GetHashCode", "GetList", "GetType", "ToString"

where's my function, ahh!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
paulb1989Commented:
The options I get after geturls.  are now "Equals", "GetHashCode", "GetList", "GetType", "ToString"

Your method is right there: "GetList"
0
 
dba123Author Commented:
Duh, it's right there, nevermind.  I was looking for the () but it doesn't show that for methods from your class I guess in Intellisense
0
 
dba123Author Commented:
but, now I have:

public partial class _Index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GetListURLs geturls = new GetListURLs(System.Configuration.ConfigurationManager.AppSettings["MyConn"]);

        VPPURLList.DataSource = geturls.GetList;
        VPPURLList.DataBind();
    }
}

and get this error:

Cannot convert method group 'GetList' to non-delegate type 'object'. Did you intend to invoke the method?
0
 
dba123Author Commented:
If it shows up in Intellisense as GetList, do I need to ad ()?  how weird.
0
 
paulb1989Commented:
you forgot the brackets:

VPPURLList.DataSource = geturls.GetList();

They don't show up in intellisense but you still have to type them.
0
 
dba123Author Commented:
ok, thanks, didn't know that.  Thanks a lot!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now