I've created a simple form containing a visual control that is modified by a thread. This application is written in Visual Studio 2005 (c#) and works fine.
I want to use this functionality in a major project. The solution file of this major project may contain the following projects:
*) main project: cfr. the main form
*) controls project: containing all of the visual controls I've designed. This also contains an inherited version of the DataGridView. All these contols are used onto the main form
*) Logic project: I don't want to write logic code into my visual controls. My forms and other visual controls have only the necessary code for adjusting the visual state of the controls (example enable/disable controls, ...)
*) other projects...
I want to do the following stuff: if one of my controls on the main form changes (user selects other radiobutton, changes date, selects another company in treeview, ...) a thread must be started. The thread retrieves the requested data and give it in chunks to the inherited datagrid. So the user doesn't have to wait until all data is retrieved! (I want to use this functionality with different grids)
Questions: How do you design this into a 3tier application? I don't want lots of references between my projects and I don't want logic into my visual layer. Does anyone knows an article about this (of has an example?) Every example I've seen concerning Threading and User Interface has all the code in one form!
Thanx!
Loading
DavidPosted Nov 22, 2007, 2:57 PM
Thanx for your reply.
sakthivel senthilnathanPosted Nov 20, 2007, 5:54 AM
hi my friend. (If I understood your requirement correctly)
I have the same kind of application in my company. I just developed a third layer (Data Access layer in between screen and the database as DLL). The dll will have all common functionality. I just pass the parameter and get the result as data table and point the result to the concern data grid.
eg.
Nathan.dll (add reference).
using Nathan
Datatable dt;
dt = Nathan.ABCFunctionFetch(ip,uid,pwd,db,storedprocedure)
Datagrid.datasource = dt;
Datagrid.Databinding();
If the answer doesnt suit your requirement let me know my friend.
regards
senthilnathan
london