I am trying to create a nested DataList with multiple subcategories listed
under each primary category. Unfortunately, I end up with a bunch of
multiple SubCategory values after iterating through the loop. My code is as
follows:
//*************** *************** *************** *************** ****
for(int i=0;i<=cat.Coun t-1;i++)
{
ds = new DataSet();
ds = catDS;
adapter = new SqlDataAdapter( "SELECT DISTINCT Category1 as CategoryName,
Category2 as CategoryName, Category3 as CategoryName, Category4 as
CategoryName, SubCategory1 AS SubCategory, SubCategory2 AS SubCategory,
SubCategory3 AS SubCategory, SubCategory4 AS SubCategory FROM Products_Table
WHERE Category1 = '"+cat[i].ToString()+"' OR Category2 =
'"+cat[i].ToString()+"' OR Category3 = '"+cat[i].ToString()+"' OR Category4
= '"+cat[i].ToString()+"' ",cnn);
adapter.Fill(ds ,"SubCategories ");
}
ds.Relations.Cl ear();
ds.Relations.Ad d("SubRelation" ,ds.Tables["Categories "].Columns["CategoryNa me
"], ds.Tables["SubCategor ies"].Columns["CategoryNa me"]);
dl1.DataSource = ds;
dl1.DataBind();
//*************** *************** *************** *************** **************
********
The resulting data looks like this:
Category1
SubCategory1, SubCategory1, SubCategory2, SubCategory3,
SubCategory3, SubCategory4
Category2
SubCategory1, SubCategory2, SubCategory3, SubCategory3
SubCategory4, SubCategory4, SubCategory4
etc. etc. ...
I'm not sure how I can fix this issue, any suggestions? 0 981 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Guy Deprez |
last post by:
Hi,
i'm having a problem to create indexes.
STEP 1
-----------
Connection is OK (you can find the string at the end of the message)
Table ("Couleurs") creation is OK
STEP 2. Index Creation
|
by: Bob |
last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem I'm experiencing is that when many users are hitting the site at once, occasionaly I will see errors. The 3 most common ones are: "The SqlCommand is currently busy Open, Fetching. ", "Internal Connection Fatal Error", "object reference not set to...
|
by: Primo |
last post by:
Hello,
I am building a data management application with the following processes:
Process 1 is a Windows service which uses FileSystemWatcher to monitor a
directory.
Process 2 opens a file copied into the directory and inserts the data into a
data warehouse.
Process 3 queries the data warehouse and transfers the results to a data mart.
|
by: pengbsam |
last post by:
Hello:
I need to write a program that search through multiple level BOM,
get all the items. It seems like a easy enough project, but when I put
my hands on it and couple of hundred lines of codes later. It starts
look more difficult. I was hopeing someone might have a very easy way
to do it that I don't know about... The BOM structure looks like this..
Father Child
A 1
A 2
|
by: HC |
last post by:
Hello, all, I started out thinking my problems were elsewhere but as I
have worked through this I have isolated my problem, currently, as a
difference between MSDE and SQL Express 2005 (I'll just call it
Express for simplicity).
I have, to try to simplify things, put the exact same DB on two
systems, one running MSDE and one running Express. Both have 2 Ghz
processors (one Intel, one AMD), both have a decent amount of RAM
(Intel system...
| |
by: SeaviewBlue |
last post by:
Howdy folks,
I am new to the site and new to joins, so I'm hoping I can get some much needed assistance.
Using ASP, VBscript & an Access 2003 db, I am building a page to display results from track and field events, and am struggling with joining information from 3 tables.
I will try to explain what I have and what I am doing as clearly as possible.
Table 1 - Results
MeetID - Field used to select records from Results table
|
by: redpears007 |
last post by:
Morning all! :)
I have a database with multiple linked tables.
I have created a search form with one txt box, for entering search
criteria, and a listbox for each of the tables to isplay the results
from that table.
These list boxes work well, but they are now cluttering the screen.
|
by: =?Utf-8?B?ZHZhbg==?= |
last post by:
I'm looking for best pratice examples on how to call multiple (1 to n) web
services asynchronously (server side) than merge the results from these web
service in to one result set.
I've written and tested a possible solution but it is written around a fixed
number of web service providers.
What I'm looking for is an example for how to dynamically call
asynchronously 1 to n web service providers based on users selection. All
the...
|
by: swethak |
last post by:
hi ,
i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that.
Here is my code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html...
|
by: Krzysztof Retel |
last post by:
Hi guys,
I am struggling writing fast UDP server. It has to handle around 10000
UDP packets per second. I started building that with non blocking
socket and threads. Unfortunately my approach does not work at all.
I wrote a simple case test: client and server. The client sends 2200
packets within 0.137447118759 secs. The tcpdump received 2189 packets,
which is not bad at all.
But the server only handles 700 -- 870 packets, when it is...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |