1

I am creating a Winforms MVC project called Cookies. Following guidelines from various searches, I have a solution with 4 separate projects: Cookies-Controller; Cookies-Model; Cookies-View and UseCookiesApplication (used as the starting stub with the program.cs file).

I got it all working with a "dummy" view with a simple listview control with hard-coded list items. However, I then wanted a "proper" view showing data from a SQL Database.

My problem is ... under which project should I generate the datasource to ensure that it is appropriately visible?

If I do so under the Cookies-Controller project then it is not visible when I go to a view in design mode. If I generate under Cookies-View then I get the error "...could not get type information for 'CookiesView.CookiesDataSet'".

I have successfully built Web-based MVC solutions, and standard winforms, but this has got me a tad confused.

Any help or pointers to other sites would be massively appreciated.

James

UPDATE: I have looked more deeply at MVP and can see it as viable alternative to Winforms MVC for what I need right now. So thanks again to #VirtualValentin and also #Jimi.

However, my original question still stands and, from a purely educational point of view, I would be grateful if someone who has developed a Winforms MVC Database application could enlighten me. James

James
  • 99
  • 8
  • Have you looked into the MVP pattern for WinForms? Also, can you provide some code examples of what is causing these errors? You can name a project whatever you want, but we need to see exactly what is causing your problem. – VirtualValentin Nov 27 '19 at 08:37
  • [Implementing MVC with Windows Forms](https://stackoverflow.com/q/654722/7444103) (a starting point). Take a look at [Reactive UI for WinForms](https://reactiveui.net/docs/guidelines/platform/windows-forms) – Jimi Nov 27 '19 at 08:45
  • #VirtualValentin thanks for your reply. Yes I have looked at MVP, but found myself lost fairly quickly and I need to present this as a Proof of Concept within a short time frame so decided to go down the MVC path as it was familiar to at least get my point across. I can put together some code, but the error is not happening in code, but rather at the generation of the datasource. (i.e.in the datasource window click "Add New Data Source"). However, I will look to your suggestions. Thanks again. – James Nov 27 '19 at 21:18
  • #Jimi thanks for your reply. I will check out those 2 links that you have kindly provided. – James Nov 27 '19 at 21:21

0 Answers0