New to Django. Can the admin panel be used as the primary app? - django-admin

All,
I've searched the forum but I'm sure I'm not searching the right terms.
Apologizes in advance for what I'm sure is a redundant question.
I have a VERY simple single table database that was managed by a foxpro app for a long time. I'm trying to move it to a web based app.
It seems like with a little customization using django-suit, the admin panel for the database really provides everything I would need.
Looking for PROS/CONS if this is appropriate.
Is this a common approach for super simple DB apps?
-Scott

I know nothing about Django so I cannot advise you on that.
I have a VERY simple single table database that was managed by a
foxpro app for a long time. I'm trying to move it to a web based app.
The assumption here is that the data table itself is a Foxpro 'native' data table (a DBF file with perhaps one or more Index files - IDX or CDX and maybe a Memo file - FPT).
However we have created Web based apps which still utilize the Old Foxpro data tables.
We created VB.Net apps which use Foxpro ODBC Connections to/from the old Foxpro data tables from our old legacy system and it works just fine.
Otherwise you will have to re-create your Foxpro data table from scratch into another database of your choice M$ SQL Server, MySQL, Django or whatever and then build your web-centric app around it.
Good Luck

Related

Is there a simple way to add a model in ASP.NET Core MVC via the GUI, besides the package manager console?

At work, I use ASP.NET MVC (not .NET Core) with Entity Framework and SQL Server. However, I wanted to practice a bit with ASP.NET Core MVC and some other SQL Server stuff (like experimenting with SSIS) at home, so I set up a small dev environment for me to work in. I created my database and tables, populated it with information, and created the default template you get with ASP.NET Core MVC. No issues so far!
But then, when I went to add a model into my project, I had no option to add an ADO.NET Entity Data Model like I do at work. After googling around a bit, I saw a mention that you could not create these kinds of models in .NET Core applications: https://learn.microsoft.com/en-us/answers/questions/357012/can39t-find-adonet-entity-data-model-missing-visua.html. I did some more googling, and it seems like just about every single thing I'm finding online is that you have to use package manager console, and type it all out.
Is this really the only way? Surely there has to be something better... It was very nice in ASP.NET MVC when I could add the model, and then it would take me through a wizard to get everything set up. I could create a new connection string, test the connection to the database, select which tables/views I wanted to add to the model, and I was all set! It was just as nice being able to go into my model and easily update the model with new tables, columns, or anything else I needed.
I get that code-first solutions are more mainstream these days, but I want to stick with the database first approach. Is there a simple, user-friendly (non package-manager console) approach for me to add models like I used to, but still get the benefits of .NET Core? Any good tutorials out there to get me on the right track (that aren't code first)? I appreciate anyone who can point me in the right direction!

How do I write to a VFP database from an MVC application

I am working with an MVC application, problem is, is it possible to write to a Visual FoxPro database from an MVC application? .. If possible any help in regards with this will be highly appreciated.
UPDATE:
I am currently working on a website for a doctor. She wants her clients to be able to make an appointment with her at and given time using the website, which must then link the clients data to VFP software that shes currently using. All i need to do is to be able to take the records of each clients bookings and write it into her current softwares database. The company that created the software for her are granting me access to her database. I am using the code first approach in MVC.
Leveen,
I'm currently doing similar access from MVC to a foxpro db. My MVC is on a different server than the foxpro table.
If you had the same setup, I recommend that you use WCF service running on the server where the foxpro database is. Your WCF will need to instantiate a VFP dll which in turn process CRUD requests to your foxpro db.
If your IIS is on the same server as the foxpro db, you can skip WCF and instantiate VFP dll directly from MVC.
Have you look into VFP Entitiy Framework Provider? https://github.com/tombrothers/VfpEntityFrameworkProvider2
Cheers
There are multiple ways to handle this. One simple way is to create a separate class library that does all the data access and CRUD operations. Within that DLL, it doesn't really matter if you are doing EF, LinqToVFP, VFP EF or direct ADO.Net commands (I wouldn't suggest COM DLL approach which could be tempting and seem to be easy initially - on the long run you might have frustrations especially with versioning).
You can individually test that class library with or without a web application (from anywhere, like a command window, windows form app, simply using LinqPad etc).
One thing you need to make sure is to enable 32 bit in application pool.

Proper ASP.NET MVC 5 Approach

Looking for some guidance as I am struggling here.
As someone who spent many years developing ASP.NET applications - that has been out of the game for 3-4 years, I am struggling to pick up the latest approaches. Probably as a result of a decade of experience.
My ASP.NET in the past was built using stored procedure calls, and the GUI was built using hand-coded HTML and JavaScript. I used JavaScript to emulate Ajax type functionality (before it was really a well known thing), and also would at times use XSLT to separate presentation from code.
Now, I am trying to move to MVC 5. It's not intuitive to me, and the few popular tutorials out there seem to be doing things that I don't want to do. For example, they are connecting to a simple table through EF, and allowing a user to view, edit or create items.
I'm looking for some basic things:
How do I get data from a stored procedure into some form of a view (GridView, or ListView, etc) - Using a controller, a View, a stored procedure as the data source (using Entity Framework? When i try DB First, and select to include procedures, I can't find them anywhere)
I'm going to want to allow them to override the value in one column. This would be stored down in the database as a different field.
This stuff was always very simple using basic web forms, but I can't find a tutorial that allows me to do anything other than just edit an existing table using EF - which isn't what I want to do. So tempted to just go back to the old fashioned way ...
This is one tutorial that was making sense to me, until it jumped into the code first approach on the database, where it went off the path from what I was looking to do:
http://www.asp.net/mvc/overview/getting-started/introduction/getting-started
Here was another one:
http://www.asp.net/mvc/overview/getting-started/database-first-development/generating-views
But this one was also different than what I was hoping to do.
I wish I wasn't so short on time with this project.
Thanks for any guidance.
You may better wait for ASP.NET 5/vNext/MVC6 release and don't waste your time on MVC5. If your project relies on SQL and works well do not use Entity Framework at all.

Continue developing live windows azure + entity framework code first side

I've worked on ASP.NET MVC site using Entity Framework code first approach.
I've finished my initial website and uploaded it to Windows Azure.
Now, I wish to continue developing the site and enhance the database structure.
The problem is that because it was created as code-first when I'll modify my entities - the database will re-created so my data will be lost.
My questions is - how can I get the live data from windows azure back to my local machine (registered accounts, posts etc.) and how can I continue developing my site without loosing that data. To be more specific - I wish to update the database structure in Azure to the new structure without losing the data inside it. I know about the entity framework DB strategics, but didn't saw anything that saves the data.
Thanks for your help!
Here are instructions for exporting form SQL Azure to blob storage.
http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx#Export
As rjovic said modifying your entities doesn't imply losing data. You can used code first migrations move data from your old entities to your new ones.

Datawarehousing with ASP.NET MVC

On one server there are more than 20 databases with identical structure but different data. I need to collect some of the data (the same queries) from all databases and store in new database which is located on another server. I decided to use ASP.NET MVC 2 but it doesn't seem logical to use more than 20 "LINQ to SQL Classes" (.dbml) files because the structure is the same for all databases and it's repeating if I use so many of these files. Is there a simple way to use one .dbml file (for remote databases) but change only connection string?
I agree that you really wouldn't want to use MVC as that is a web framework and has nothing to do with moving data around.
You can also look into using an ETL tool to accomplish this task. I have used RhinoETL in the past successfully to accomplish something similar.
There are also multiple posts on this site discussing ETL tools. For example, check the following link - https://stackoverflow.com/questions/51198/what-etl-tool-do-you-use
According to this, you can pass in a connection string with the dataContext constructor. So theoretically, you should be able to have one dbml file, but you can instantiate multiple instances of your data context, each with a different database connection string specified. Each context should then point to their respective database and allow you to work with multiple databases.
Why do you want to use ASP.NET MVC at all? ASP.NET is for web UI, not data warehousing (except when you need to display cubes). Looks like you use SQL Server. If that is true you can utilize Integration Services (ex DTS) to do the job.

Resources