Results 1 to 3 of 3

Thread: [2.0] IhirearchicalDataSource datasource

  1. #1

    Thread Starter
    Hyperactive Member r0k3t's Avatar
    Join Date
    Dec 2005
    Location
    Cleveland
    Posts
    361

    [2.0] IhirearchicalDataSource datasource

    Hi there,

    So I am stuck using some objects that someone else bought off the web - don't blame me I am not the boss... At any rate I am trying to make this slide menu thing work. I finally posted to the companies website and they told me I couldn't use SqlDataSource, they said it is not a IhirearchicalDataSource. Now I went out and researched this and I seem to understand somewhat, at least I understand what the mean. What I don't understand is how should I be implementing this? Should I not use the sqlClient classes?

    I guess the big question how do I change the code below to make that work then? Have a quick look!

    VB Code:
    1. Connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ecommerceConnectionString"].ConnectionString);
    2.            Connection.Open();
    3.            Command selectAllIndustries = new SqlCommand("GetAllIndustires", Connection);
    4.            selectAllIndustries.CommandType = CommandType.StoredProcedure;
    5.            DataSet ds = new DataSet();
    6.            SqlDataAdapter da = new SqlDataAdapter(selectAllIndustries);
    7.            da.Fill(ds);
    8.      
    9.            SlideMenu1.DataSource = ds.Tables[0];
    10.            SlideMenu1.DataFields = "Name";
    11.            SlideMenu1.DataBind();

    From the website of the objects.

    "Actually your code is correct. What I was saying is for your instance, SqlDataSource won't work for SlideMenu. Which means you can not assign a SqlDataSource as SlideMenu's datasource. The reason is that SqlDataSource is not an IhirearchicalDataSource, which means our slideMenu only can work with datasource which inherits IHierarchicalDataSource interface."

    So what? Do I use an OleDb data source? They just doesn't seem to make any sense...

    Thanks

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [2.0] IhirearchicalDataSource datasource

    I'd drop the control, use another one (something that makes sense) or build it from scratch to meet my standards.

    But you can create a class that inherits the SqlDataSource and implements IHierarchicalDataSource interface which by the way is not a .NET built-in interface. Or you can just contact them for the solution which might be the best way

    But whatever you do would get you better results than asking people who don't know what are you talking about!!
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] IhirearchicalDataSource datasource

    Quote Originally Posted by ComputerJy
    IHierarchicalDataSource interface which by the way is not a .NET built-in interface.
    Not true. It is the System.Web.UI.IHierarchicalDataSource interface. Go to the MSDN library and read about, understand it and then either use an existing class that implements it or else define your own class that implements it. It only has one method: GetHierarchicalView. You need to implement that method to get the data inside your object and return it contained in a HierarchicalDataSourceView object.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width