Solved

Intellisense not finding my method

Posted on 2006-07-16
9
211 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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