Databinding to Table Data - with a twist.

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
Hey all.

I have an interesting problem.

I have a table that contains settings for my application.

Now, instead of going the conventional route of having a data column per setting (which was just not practical, considering I have hundreds of available settings), I have them Arranged in rows.

Also, in order to have a master list of what settings are available, I have a reference table in a SQL compact database (nice and easy to swap-out :-)

To illustrate;

SettingsMaster Table

ID*** SettingName*** DataType * DefaultValue
--------------------------------------------------------
1***** SomeSetting*** Integer***** -1
2***** OtherSett******* Boolean***** True


and so on.

I then have the table where the settings Values are stored:

tblSettings

ID****** SettingID***** Value
--------------------------------
1******** 1****************** 7
2******** 2****************** False


OK. Still with me? Good.


I have written a GetSetting(SettingName as string) and a matching SetSetting.


What I would like to do, is be able to DataBind to my 'Settings System' - which would have been easire if I had used Column-Per-Setting, but I hope I can still do it with my Row-Per-Setting

I understand I would probably have to create a new class, and I have a feeling I'll need to implement an interface, but I have NO IDEA where to go from here.



I hope you guys can help :-)


More...

View All Our Microsoft Related Feeds
 
Back
Top