Solved

Intellisense not finding my method

Posted on 2006-07-16
9
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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