This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Still new at using lightspeed. Is there a better way to do this? var query = work.LocationOptions;nameTextBox.Text = query.Where(o => o.KeyName == "location_name").Select(o => o.Value).FirstOrDefault();addressTextBox.Text = query.Where(o => o.KeyName == "location_address").Select(o => o.Value).FirstOrDefault();cityTextBox.Text = query.Where(o => o.KeyName == "location_city").Select(o => o.Value).FirstOrDefault();stateTextBox.Text = query.Where(o => o.KeyName == "location_state").Select(o => o.Value).FirstOrDefault();zipCodeTextBox.Text = query.Where(o => o.KeyName == "location_zipcode").Select(o => o.Value).FirstOrDefault();Should I be filling in a dataset, then binding it to the text boxes? Thanks. |
|
|
Am I right in thinking a LocationOption is a key-value pair, and that there is a single global set of key-value pairs? Could you say a bit more about your domain model? I would have thought a more natural model would be to have LocationOption be a class something like: public class LocationOption : Entity<int> { and you could then databind your text boxes to that object and its properties in the normal way. But perhaps I am misunderstanding? |
|
|
LocationOption is mysql table, id, key, value.. Trying to figure out the best way to bind the info to text boxes. Not sure if what I am doing is the proper way or not. Its part of an interface program to the db. |
|