Generic BO?


Author
Message
Ian Hammond
Ian Hammond
StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)StrataFrame Novice (81 reputation)
Group: Forum Members
Posts: 57, Visits: 277
My application can read a user defined database whose structure is not known until runtime. A separate application allows the user to create the database and saves information in a known configuration database  which comprises the field names and the type of controls to be created on the WinForm top display the data. I'm not sure where to start to create a generic BO (if possible) that can perform the CRUD operations on the 'unknown ' database structure. Can anyone point me in the right direction,

Many thanks for your time

Reply
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Ian,



It might be possible, but I'm not sure if it's a good idea. The place to start is to look at the designer code of a BO Mapper generated BO. This will give you an idea of what is needed. Many of the public methods within the designer file could be pretty easily modified to just get meta data from a table (like the database name, the table name, list of fields). However, some are going to be hard, like the enum of field names. Some are going to be very hard, like the static lists and property descriptors. I'm not sure what exactly is necessary to get CRUD working (i.e. maybe the enum isn't strictly necessary...don't know) and what exactly is necessary to manage binding.



I didn't look into this real deeply, but I think Les is likely suggesting a better path of just using native ADO.NET with native .NET binding functionality in a situation like this. I'll be interested to hear what you discover and decide to use.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search