Hey, I'm stuck with a problem I have to get sorted out!!
I'm need to group data thats already been loaded into a dataset. The data is loaded populated to a dropdownlist. Sql server database in case you're wondering... The user must select the desired printer model, and the next query fires, retieving all the different cartridges available to that model fro the database!
The thing is the database holds data on printer cartridges. Now some printer models have more than one type of cartridge, making the same printer model appear more than once in the dropdownlist. The query pulls the data from the data base an populates it. Now I have the problem that not all the fields in the database table are in the dataset, so I cant just do a normal 'GROUP BY' clause on the field in the database, since the data in the dataset is already queried by the printer type, eg.Inkjet, or Laserjet, etc. So now, say, I want to check the Lexmark manufacturer, the Inkjet type. So out of the table comes all Inkjet models for Lexmark. Now the table holds data on all printer types, not just inkjet... This makes a normal GRUOP BY clause unusable, since the table and dataset records are different....
eg. I would get something like this in my dropdownlist:
Lexmark 1200
Lexmark 1200
Lexmark 1200
Lexmark 1200
Lexmark 1400
Lexmark 1400
Lexmark 3200
Lexmark 3200
Instead I'd like this result, having the data grouped for user friendlyness, etc:
Lexmark 1200
Lexmark 1400
Lexmark 3200
I just cant get my head around how I can achieve this. If anyone could be of any kind of help, or give some suggestions, I'd appreciate it! THANX!
I'm need to group data thats already been loaded into a dataset. The data is loaded populated to a dropdownlist. Sql server database in case you're wondering... The user must select the desired printer model, and the next query fires, retieving all the different cartridges available to that model fro the database!
The thing is the database holds data on printer cartridges. Now some printer models have more than one type of cartridge, making the same printer model appear more than once in the dropdownlist. The query pulls the data from the data base an populates it. Now I have the problem that not all the fields in the database table are in the dataset, so I cant just do a normal 'GROUP BY' clause on the field in the database, since the data in the dataset is already queried by the printer type, eg.Inkjet, or Laserjet, etc. So now, say, I want to check the Lexmark manufacturer, the Inkjet type. So out of the table comes all Inkjet models for Lexmark. Now the table holds data on all printer types, not just inkjet... This makes a normal GRUOP BY clause unusable, since the table and dataset records are different....
eg. I would get something like this in my dropdownlist:
Lexmark 1200
Lexmark 1200
Lexmark 1200
Lexmark 1200
Lexmark 1400
Lexmark 1400
Lexmark 3200
Lexmark 3200
Instead I'd like this result, having the data grouped for user friendlyness, etc:
Lexmark 1200
Lexmark 1400
Lexmark 3200
I just cant get my head around how I can achieve this. If anyone could be of any kind of help, or give some suggestions, I'd appreciate it! THANX!