SubSonic Change DropDown Value for Load Drops SUB

subsonic

I used the subsonic generator to create some aspx pages, It works fine.
On some of the pages it automaticaly generated the dropdown boxes for foreign key values.
How Can change that value in the load drops code? Or where I need to change it.

For instance I have a workers table and a workersweek table.
The workers table has a workerid,firstname and lastname field and the workersweek has a workerID field.
The generator automatically set it up to show the firstname in the dropdown. I want to change the value to be both firstname and lastname.

I am sure I will have to add code that does something like firstname + " " + Lastname.

I am just not sure where to do it withing the code that was generated. I see the load drops sub, but it does not seem like that is the one I need to modify.

Best Answer

If it loads from a foreign key then it loads from a database table.

If you need to concat fields in the query, try making a view with the fields concatenated. e.g. select fName + ' ' + lName as FullName from table

Then in the code behind for the aspx page, select that from the view to load the combobox.