Home Search Member List Faq Register Login  
UltimateSitemap
Where to use 'WHERE'

Thread Starter: TonyP   Started: 05-02-2006 7:59 AM   Replies: 11
 Karamasoft Support Forums » General Discussions » UltimateSitemap » Where to use 'WHERE'
 Printable Version    « Previous Thread   Next Thread »
  02 May 2006, 7:59 AM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Where to use 'WHERE'
Hi,

I need to filter the ultimatesitemap table during query, I cannot see anything in code behind where this could be used, is there an easy way to do this.

Thanks

Tony

  
  02 May 2006, 9:32 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
It's doing everything behind the scenes based on a predefined query. If you want to override it you need to create your own dataset using your own query, and then set the DataSource property of UltimateSitemap as in the DataBinding sample.
  
  03 May 2006, 1:26 AM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Re: Where to use 'WHERE'
That makes sense! do you have any examples or documentation on how this is done using a SQL server database?

Thanks for your help.

  
  03 May 2006, 8:51 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
file:///C:/Inetpub/wwwroot/Karamasoft/UltimateSitemap/v2.1/Controls/Documents/UltimateSitemapTutorial.htm#Q7
  
  03 May 2006, 9:41 AM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Re: Where to use 'WHERE'
I'm using C#, the example is in VB, do you have an example in C#

Thanks, and sorry for being a pain in the ***

Tony

  
  03 May 2006, 9:54 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
string connStr = "YOUR CONNECTION STRING GOES HERE";
string sitemapId = "Sitemap1";
OleDb.OleDbDataAdapter adpSitemap =
new OleDb.OleDbDataAdapter(("SELECT * FROM UltimateSitemap WHERE
(sitemapID = \'" + (sitemapId + "\') ORDER BY parentNodeID, sortOrder")), connStr);
DataSet sitemapDataSet = new DataSet("UltimateSitemap");
adpSitemap.Fill(sitemapDataSet, "UltimateSitemap");
UltimateSitemap1.DataSource = sitemapDataSet;

  
  04 May 2006, 7:48 AM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Re: Where to use 'WHERE'
Hi,
I get this error:

error CS0246: The type or namespace name 'OleDb' could not be found (are you missing a using directive or an assembly reference?)

Any clues?
Thanks
Tony

  
  04 May 2006, 9:08 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
You may need to use SqlClient instead of OleDb. Please get more familiar with ADO.NET and ADO.NET 2.0 at http://msdn.microsoft.com/library and http://msdn2.microsoft.com/library repesctively based on the .NET framework you use.
  
  07 May 2006, 12:41 PM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Re: Where to use 'WHERE'
Hi,
I am using a trial version, and am up against it, normally I would send many hours researching, but, it possible you can assist with this?
I know you have better things to do, just a few more hints as to the correct direction??????

Thanks

Tony

  
  08 May 2006, 9:09 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
Are you using .NET Framework 1.1 or 2.0?
  
  08 May 2006, 9:25 AM
TonyP is not online. Last active: 5/8/2006 9:25:04 AM TonyP

Top 10 Posts
Joined on 04-28-2006
UK
Posts 9
Re: Where to use 'WHERE'
.NET 2.0, for my sins!!

Thanks

Tony

  
  08 May 2006, 10:05 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Where to use 'WHERE'
Please find below the code we tested with. Also note that we created a database called "sitemap" and created the "UltimateSitemap" table in it. You may need to follow the steps in the tutorial to create and fill in this table if you haven't done so:

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

string connStr = "Provider=SQLOLEDB;User ID=username;Password=password;Initial Catalog=sitemap;Data Source=(local);";

string sitemapId = "Sitemap1";

System.Data.OleDb.OleDbDataAdapter adpSitemap = new System.Data.OleDb.OleDbDataAdapter(("SELECT * FROM UltimateSitemap WHERE (sitemapID = \'" + (sitemapId + "\') ORDER BY parentNodeID, sortOrder")), connStr);

DataSet sitemapDataSet = new DataSet("UltimateSitemap");

adpSitemap.Fill(sitemapDataSet, "UltimateSitemap");

UltimateSitemap1.DataSource = sitemapDataSet;

}

}


  
 Page 1 of 1 (12 items)
Karamasoft Support Forums » General Discussions » UltimateSitemap » Where to use 'WHERE'

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.