Solved

Intellisense not finding my method

Posted on 2006-07-16
9
214 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…

726 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