Thread: Question Populating combobox
View Single Post
  #7 (permalink)  
Old 10-21-2008, 9:13 AM
cjard's Avatar
cjard cjard is offline
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 64
Posts: 5,375
Reputation: 539
cjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalistcjard VB.NET gold medalist
Default

Heh, yeah, i do sound like a bit of a broken record with DW2.. but so often I find people following old/out of date tutorials etc..

In this case if you have many combos, I would be tempted to make things a little simpler and jsut have one DataTable/TableAdapter with a Display and Value columns, then the TA can have several related queries:

SELECT Name as Display, ID as Value FROM tblStates
SELECT Name as Display, ID as Value FROM tblProvinces WHERE StateID = @StateID
SELECT Name as Display, ID as Value FROM tblTowns WHERE ProvinceID = @ProvinceID

...
__________________
"it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ
Reply With Quote