Backgound: We have a Windows Forms Data Driven Framework which enables users to:
Create database tables, their relationships and their Persian names.
Create database views from that tables.
Create a Windows Forms Form from a table or view and then opening it to perform Insert, Update and Delete on it. The Form:
Supports lookup for foreign keys via a Combobox which it's DisplayMember and ValueMember can be set by user via another table or a stored procedure.
Supports selecting a subset from existing fields to be shown on form.
Supports searching, filtering, master-detail form opening, sending a record to another dll for custom actions and also it will autosize itself and it's underlying controls.
The user can do all of above at runtime without any compilation via a Persian GUI. All required informations are stored in database.
Looking for: We want to migrate our framework to web to support our web customers.
But at first only the form opening.
While all required informations are stored in the database, we want to enable just opening a web form (which have been created via our Windows Forms Data Driven Framework) at runtime without any compilation
to allow user to Insert, Update and Delete records via a web form. The opened web form should be as more as possible like the Windows Forms Form (in functionality and interface).
We have been tried the ASP.NET Dynamic Data but it's not dynamic enough e.g. you need to drag&drop tables to project and for setting a caption for a field you have to hard code it via attributes and compile again. In summary a lot of stuffs should be hard
coded manually!
What question is not: The question is not "How to do this step-by-step?".
What question is: While we hear alot about several things like ASP.NET MVC, ASP.NET Design Patterns, AJAX, Silverlight, etc every day, and also we are almost new to ASP.NET technology the main question is "From where we should get start?",
"Should we extend current ASP.NET Dynamic Data? Is this possible for a flexible Data Driven Framework?" or
we should write our own from scratch using ASP.NET? "Is there any other thing ready to do these?"
Backgound: We have a Windows Forms Data Driven Framework which enables users to:
Create database tables, their relationships and their Persian names.
Create database views from that tables.
Create a Windows Forms Form from a table or view and then opening it to perform Insert, Update and Delete on it. The Form:
Supports lookup for foreign keys via a Combobox which it's DisplayMember and ValueMember can be set by user via another table or a stored procedure.
Supports selecting a subset from existing fields to be shown on form.
Supports searching, filtering, master-detail form opening, sending a record to another dll for custom actions and also it will autosize itself and it's underlying controls.
The degree of complex that convert a windows form applicaiton to asp.net application depond upon your origial design of windows form. The general operations above surely you can implement in the asp.net application. I assume you developed the windows form
appliation with 3-tire architecture. At this case, you can easy-to-use the classlibraries built in the windows form applcation to create asp.net applicaiton. You just need to change the client/UI.
Yasser B Zamani
the main question is "From where we should get start?", "Should we extend current ASP.NET Dynamic Data? Is this possible for a flexible Data Driven Framework?" or
we should write our own from scratch using ASP.NET? "Is there any other thing ready to do these?"
Well, as I mentioned previously, if the dll/classlibraries can be reused in the asp.net application, you don't need to develop the Data Driven app from scrach, using the general asp.net application can meet your scenario
Fortunately, our Windows Forms Data Driven Framework (WFDDF) is 3-tier and I knew that we can reuse it's layers. The things that I don't know are:
1. Our WFDDF is strongly using "BindingSource" which I could not find an equalent for it in ASP.NET. So we have to rewrite all codes to using SqlDataSource instead! (Am I right?)
2. Our WFDDF is strongly using "controls runtime dynamic binding". Currently we simply write "textBox1.DataBindings.Add("Text", bindingSource1, ...)" but in ASP.NET as I saw, the bindings are hard-coded in .aspx file via properties of <asp:TextBox
tag! and I could not find a property like "DataBindings" for TextBox server control to dynamically binding it. (Am I right?)
3. Finally our WFDDF's DataLayer is not a
LINQ to SQL. It contains only a set of C# classes which have been writed by hand and will perform required SQL queries against the underlying database via an OO interface in an ADO.NET model. Now the problem is is this datalayer reusable
for ASP.NET Dynamic Data while ASP.NET Dynamic Data needs a LINQ to SQL in it's underlying and
if we add a new table then we have to change the LINQ to SQL then we have to re-compile the whole again; it's really not suitable for our goals!. (Am I right?)
I don't need a complete solution but just to know if I am wrong and need more research. If so, a little information about where to finding solutions for above three issues.
For the first question, I guess BindingSource is a data source just as SqldDataSource in the asp.net application. For the both objects, you need to bind specific data to them. How to bind? Well, it's the task that BI tier need to operate(I assume the 3-tires
are UI, BI and DA). In a nutshell, you just need to call the BI tire's method to retrieve the data at the UI tire and then bind the data to BindingSource/SqlDataSource.
For the second question, I think you need to konw how to present and manage data for asp.net:
You can bind the data to ASP.NET TextBox control dynamically like this:
TextBox1.Text="data from database"
For the third question, it's not required to use Linq To SQL.(Linq to SQL also can be applied to Windows Form applicaiton, not only ASP.NET applicaiton)
Please mark the replies as answers if they help or unmark if not.
Feedback to us
About that link, I think there are good info there; I'll research their and let you know, thanks.
But about the last paragraph, did you mean that we can run Dynamic Data over only a set of C# classes rather than a LINQ to SQL file? our current WFDDF get only a connection string and then allow to create even a new table and immedietly then (without any
extra compilation) allow to create a form from the added table and manipulating data. Does Dynamic Data allow dynamic data struture changes like this?! If so, could you please post me a getting started link with a custom datalayer for DynamicData?
Thank you for answering an ASP.NET newbie; however I was a MSFT Visual C# MVP at 2011;)
About SqlDataSource I should say that seems really different from BindingSource
I kown that and I just mean the BingdingSource's the data source as the SqlDataSource in the asp.net. Don't mean they are equal.
Yasser B Zamani
however I was a MSFT Visual C# MVP at 2011;)
Amazing!
Yasser B Zamani
did you mean that we can run Dynamic Data over only a set of C# classes rather than a LINQ to SQL file?
Yes! When we create a 3-tires app, most of time we map the table of database to corresponding entity class. For example, if you have a table(named "userInfo") including 3 columns(username, userpwd, useraddress), you always create a corresponding class including
3 members(username, userpwd,useraddress).
Yasser B Zamani
Does Dynamic Data allow dynamic data struture changes like this?! If so, could you please post me a getting started link with a custom datalayer for DynamicData?
Some confused about this. But if you want to use ASP.NET Dynamic Data, that mean you need to create data driven app from scatch.
For information about ASP.NET Dynamic Data you can view my reply above.
BTW, you konw I don't kown what your whole windows form app's structure exatcly. So my replies just are adivice and have you refer.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
You're welcome, I was aware for the weekend and also aware that MSFT does not leave a thread unanswered ;)
Thank you for the answers, I think now, I know the main ideas, the rest is researching more and doing some basic work example to learn the technology and walkthrouting to end.
Yasser B Zam...
Member
91 Points
38 Posts
Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 07, 2012 06:40 AM|LINK
Hi experts,
Backgound: We have a Windows Forms Data Driven Framework which enables users to:
The user can do all of above at runtime without any compilation via a Persian GUI. All required informations are stored in database.
Looking for: We want to migrate our framework to web to support our web customers. But at first only the form opening. While all required informations are stored in the database, we want to enable just opening a web form (which have been created via our Windows Forms Data Driven Framework) at runtime without any compilation to allow user to Insert, Update and Delete records via a web form. The opened web form should be as more as possible like the Windows Forms Form (in functionality and interface).
We have been tried the ASP.NET Dynamic Data but it's not dynamic enough e.g. you need to drag&drop tables to project and for setting a caption for a field you have to hard code it via attributes and compile again. In summary a lot of stuffs should be hard coded manually!
What question is not: The question is not "How to do this step-by-step?".
What question is: While we hear alot about several things like ASP.NET MVC, ASP.NET Design Patterns, AJAX, Silverlight, etc every day, and also we are almost new to ASP.NET technology the main question is "From where we should get start?", "Should we extend current ASP.NET Dynamic Data? Is this possible for a flexible Data Driven Framework?" or we should write our own from scratch using ASP.NET? "Is there any other thing ready to do these?"
Thanks in advance,
Sincerely,
Yasser.
Yasser B Zam...
Member
91 Points
38 Posts
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 09, 2012 03:36 PM|LINK
Any help please? sorry for my long words. I really could not write less!
Mamba Dai - ...
All-Star
23531 Points
2683 Posts
Microsoft
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 13, 2012 07:21 AM|LINK
Hi Yasser,
The degree of complex that convert a windows form applicaiton to asp.net application depond upon your origial design of windows form. The general operations above surely you can implement in the asp.net application. I assume you developed the windows form appliation with 3-tire architecture. At this case, you can easy-to-use the classlibraries built in the windows form applcation to create asp.net applicaiton. You just need to change the client/UI.
Well, as I mentioned previously, if the dll/classlibraries can be reused in the asp.net application, you don't need to develop the Data Driven app from scrach, using the general asp.net application can meet your scenario
http://www.asp.net/web-forms,
Insteed, that means you need to redesign your asp.net-based data driven app, the ASP.NET Dynamic Data may you consideration:
http://msdn.microsoft.com/en-us/library/ee845452.aspx
Feedback to us
Develop and promote your apps in Windows Store
Yasser B Zam...
Member
91 Points
38 Posts
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 13, 2012 08:05 AM|LINK
Hi Mamba,
Thank you very much for your advices!
Fortunately, our Windows Forms Data Driven Framework (WFDDF) is 3-tier and I knew that we can reuse it's layers. The things that I don't know are:
1. Our WFDDF is strongly using "BindingSource" which I could not find an equalent for it in ASP.NET. So we have to rewrite all codes to using SqlDataSource instead! (Am I right?)
2. Our WFDDF is strongly using "controls runtime dynamic binding". Currently we simply write "textBox1.DataBindings.Add("Text", bindingSource1, ...)" but in ASP.NET as I saw, the bindings are hard-coded in .aspx file via properties of <asp:TextBox tag! and I could not find a property like "DataBindings" for TextBox server control to dynamically binding it. (Am I right?)
3. Finally our WFDDF's DataLayer is not a LINQ to SQL. It contains only a set of C# classes which have been writed by hand and will perform required SQL queries against the underlying database via an OO interface in an ADO.NET model. Now the problem is is this datalayer reusable for ASP.NET Dynamic Data while ASP.NET Dynamic Data needs a LINQ to SQL in it's underlying and if we add a new table then we have to change the LINQ to SQL then we have to re-compile the whole again; it's really not suitable for our goals!. (Am I right?)
I don't need a complete solution but just to know if I am wrong and need more research. If so, a little information about where to finding solutions for above three issues.
Thanks in advance!
Mamba Dai - ...
All-Star
23531 Points
2683 Posts
Microsoft
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 13, 2012 09:08 AM|LINK
Hi,
Nice to hear it's a 3-tire architecture app.
For the first question, I guess BindingSource is a data source just as SqldDataSource in the asp.net application. For the both objects, you need to bind specific data to them. How to bind? Well, it's the task that BI tier need to operate(I assume the 3-tires are UI, BI and DA). In a nutshell, you just need to call the BI tire's method to retrieve the data at the UI tire and then bind the data to BindingSource/SqlDataSource.
For the second question, I think you need to konw how to present and manage data for asp.net:
http://www.asp.net/web-forms/overview/presenting-and-managing-data
You can bind the data to ASP.NET TextBox control dynamically like this:
For the third question, it's not required to use Linq To SQL.(Linq to SQL also can be applied to Windows Form applicaiton, not only ASP.NET applicaiton)
Feedback to us
Develop and promote your apps in Windows Store
Yasser B Zam...
Member
91 Points
38 Posts
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 13, 2012 11:14 AM|LINK
Thank you for the response, Mamba.
About SqlDataSource I should say that seems really different from BindingSource. e.g. http://forums.asp.net/t/1645349.aspx/1
About that link, I think there are good info there; I'll research their and let you know, thanks.
But about the last paragraph, did you mean that we can run Dynamic Data over only a set of C# classes rather than a LINQ to SQL file? our current WFDDF get only a connection string and then allow to create even a new table and immedietly then (without any extra compilation) allow to create a form from the added table and manipulating data. Does Dynamic Data allow dynamic data struture changes like this?! If so, could you please post me a getting started link with a custom datalayer for DynamicData?
Thank you for answering an ASP.NET newbie; however I was a MSFT Visual C# MVP at 2011;)
Mamba Dai - ...
All-Star
23531 Points
2683 Posts
Microsoft
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 16, 2012 03:54 AM|LINK
Hi,
Sorry for delaying replying as the weekend.
I kown that and I just mean the BingdingSource's the data source as the SqlDataSource in the asp.net. Don't mean they are equal.
Amazing!
Yes! When we create a 3-tires app, most of time we map the table of database to corresponding entity class. For example, if you have a table(named "userInfo") including 3 columns(username, userpwd, useraddress), you always create a corresponding class including 3 members(username, userpwd,useraddress).
Some confused about this. But if you want to use ASP.NET Dynamic Data, that mean you need to create data driven app from scatch.
For information about ASP.NET Dynamic Data you can view my reply above.
BTW, you konw I don't kown what your whole windows form app's structure exatcly. So my replies just are adivice and have you refer.
Feedback to us
Develop and promote your apps in Windows Store
Yasser B Zam...
Member
91 Points
38 Posts
Re: Migrating from a Windows Forms Data Driven Framework to an ASP.NET one
Apr 16, 2012 04:20 AM|LINK
You're welcome, I was aware for the weekend and also aware that MSFT does not leave a thread unanswered ;)
Thank you for the answers, I think now, I know the main ideas, the rest is researching more and doing some basic work example to learn the technology and walkthrouting to end.
Thanks again!