vb.net 2005 q] sql query configuration utility config select statement

Domino2006

Member
Joined
Jan 31, 2007
Messages
5
Programming Experience
1-3
Good Evening Ladies and Gents.

Ok im stillstuck with my project. Im Hopeing that you good people (The Hub Of Programming Inteligence) can help me coz im so stuck.

I have 1 dataset with 26 tables all have a primary key but no foreign keys. in the very first table there is a bit array that gets set equal to 1 (boolean=true). What i cant figure out is how i can use the dataset configuration utility. i know how to set a select statement so that when i call the FILL method on the first table it searches for the table that has a bit array set =1. but my problem being that i want to be able to fill the first table that has the bit array set to 1 and then fill all the corrosponding tables that have the same primary key as the first one. So in short theres 26 tables 1 is an address table that has a bit set to 1 and im trying to fill the dataset with the rest of the tables that have the same primary key. PLZZ PLZZ help.

Ill even give you a mention in the about box. plzz state your first name and where your from. Thanx in advance.

Domino2006 (A developer in the makeing) :confused:
 
It goes something like this:

VB.NET:
Public Sub FillTables
 
  MainTableTableAdapter.FillByBitArray(MyDataSet.MainTable)
 
  For Each ro as MyDataSet.MainTableRow in MyDataSet.MainTable
    Table2TableAdapter.FillByAPrimaryKey(MyDataSet.Table2, ro.PrimaryKeyColumn)
    Table3TableAdapter.FillByAPrimaryKey(MyDataSet.Table3, ro.PrimaryKeyColumn)
    Table4TableAdapter.FillByAPrimaryKey(MyDataSet.Table4, ro.PrimaryKeyColumn)
    ...
    Table24TableAdapter.FillByAPrimaryKey(MyDataSet.Table24, ro.PrimaryKeyColumn)
    Table25TableAdapter.FillByAPrimaryKey(MyDataSet.Table25, ro.PrimaryKeyColumn)
    Table26TableAdapter.FillByAPrimaryKey(MyDataSet.Table26, ro.PrimaryKeyColumn)
  Next ro
End Sub

Nope, you cant get it to do it auto - you must fill them yourself, which means 26 instances of tableadapters..


The thing i must point out is.. if you have 26 tables who share primary keys, you should only have one table!!

I.e. if PersonID 123 is the primary key for all 26 tables, relating to 26 (or more) bits of info about this one person, then all the data should be in one table!
 
Back
Top