Solved

Intellisense not finding my method

Posted on 2006-07-16
9
204 Views
Last Modified: 2010-04-16
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
Comment
Question by:dba123
  • 6
  • 3
9 Comments
 
LVL 5

Expert Comment

by:paulb1989
ID: 17119180
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
 
LVL 1

Author Comment

by:dba123
ID: 17119191
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
 
LVL 1

Author Comment

by:dba123
ID: 17119197
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
 
LVL 5

Accepted Solution

by:
paulb1989 earned 500 total points
ID: 17119232
The options I get after geturls.  are now "Equals", "GetHashCode", "GetList", "GetType", "ToString"

Your method is right there: "GetList"
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 1

Author Comment

by:dba123
ID: 17119291
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
 
LVL 1

Author Comment

by:dba123
ID: 17119309
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
 
LVL 1

Author Comment

by:dba123
ID: 17119313
If it shows up in Intellisense as GetList, do I need to ad ()?  how weird.
0
 
LVL 5

Expert Comment

by:paulb1989
ID: 17119316
you forgot the brackets:

VPPURLList.DataSource = geturls.GetList();

They don't show up in intellisense but you still have to type them.
0
 
LVL 1

Author Comment

by:dba123
ID: 17119318
ok, thanks, didn't know that.  Thanks a lot!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now