In Subsonic 2 I played around with the Scaffold controls to build some quick and dirty admin pages. I need to do the same again but am using Subsonic 3 where I don't see Scaffold anywhere.
Is Scaffolding in Subsonic dead?
Any other recommendations to get admin pages for db tables (ms sql) up as fast as possible using Subsonic?
Related
I'm new to MVC, and my intention actually is to learn 'Code First' technique, using MVC 4. I'd been through several 'MVC 4 Entity Framework' tutorials, and no doubt, tutorials are really simple, and understandable. but for every tutorial I followd, the
EF will look for the database in the default location and if it doesn’t exist, it will create it for you
part is not working for me. Do i have to add ADO.net Entity framework model in project, and design the database entities firt? or am I missing something? It's been more than 15 days, & I'm stuck.
(I tried making database manually first, and it worked perfect. But I want to learn, as described in tutorials, that databases are automatically created, if we mention the connection string, and EntityFramework finds out that path doesn't actually contains such database, so it creates one).
I'd been through several tutorials, let's say, I'm following THIS one.
(I'm using Visual Studio Express for web 2012, EF 5.0.0)
your question: Do i have to add ADO.net Entity framework model in project, and design the database entities firt?
yes, in code first approach you need to tell entity framework what tables you are going to create, you do it by creating poco classes(Plain old CLR Object). then in run time entity framework will create a model(witch is a xml file) and generate query according to that xml file then executes it. you can read more about that in [CSDL MSL CSDL][1]
so for summary you write your domain classes(poco classes) and ef will create db for you but btw there is another way where in entity framework code first witch is called [Code first to existing database][2]
[2]: http://weblogs.asp.net/scottgu/archive/2010/08/03/using-ef-code-first-with-an-existing-database.aspx it revers engineer the databse and create model for you.
Do i have to add ADO.net Entity framework model in project, and design the database entities first?
This is really the more traditional approach, aptly called the database-first approach. The code-first approach is an alternative to the former. They mean exactly what they say. In the case of code-first the code is first written and in effect the database is generated automatically. In database approach, the database is first created then you can use EF to automatically generate the code required to handle the database, mainly CRUD and connection management.
The built-in scaffolder in ASP.NET MVC should work fine either in code-first or database-first as long as you have your models already established in your project. If you find the generated code too simplistic, an alternative scaffolder that you can use is CamoteQ - it is an online ASP.NET MVC scaffolding tool that is based in DDD principles and recognized patterns.
I wrote an e-commerce app and used SubSonic 2.2 to generate the Data-Access-Layer.
It works perfectly with Sql Server 2005 and 2008.
However I would like to add support for SQL Azure.
Does anyone know if the code generated by SubSonic 2.2 with work with SQL Azure?
Side note:
If there are big issues I may scrap the 2 yrs old Data-Access-Layer and use Telerik ORM.
thanks
I'm not that familiar with SQL Azure, but I understand it supports T-SQL. In that case, it shouldn't be too difficult to adapt SubSonic to it.
However, changing the template files will not be enough, you will need to modify the source project and rebuild it. I say this because the SubSonic dll contains references to the various ADO.Net providers it supports (Microsoft.Practices.EnterpriseLibrary.Data, MySql.Data, System.Data.SQLite, System.Data.SqlServerCe).
I would consider / strongly advise using something like EntityFramework which is fully supported. Other fully support ORMs include Lightspeed, nHibernate etc.
Pardon the vague question, but I've just inherited a project to build a couple dozen forms pulling data from a SQL 2005 database. The forms are mostly standard database lookups with just a couple updates so the data layer is very simple -- I'm the DBA -- but we just recently started using SharePoint WSS 3.0 for a departmental web site and I would prefer to integrate these forms into WSS rather than build a separate standalone ASP.NET app.
I'm hoping there is some RAD framework out there that integrates with WSS for data bound forms. I've been searching online, but haven't found anything very promising and the data viewer web part in SharePoint Designer looks complicated to integrate with an external SQL database.
TIA,
Rusty
Given that there isn't any real integration with SharePoint happening, the easiest option is probably to build the forms as standard .net user controls then add them to SharePoint using SmartPart.
I am evaluating SubSonic for use in Phase 2 of a large project. This is an ASP.NET project, with 700 tables in a SQL Server database.
We are planning for our domain model to consist of POCO classes to assist with an offline access requirements we have. I believe that the SimpleRepository pattern would be among my best options.
Since I have a database already, however, the migration assistance doesn't help me. Are there T4 templates for SimpleRepository that I just overlooked? How do I 'turn off' migration? If I missed something in the Wiki, point me there, otherwise get me started and I'll write up a Wiki entry for y'all when we get there.
I'd suggest you look at the linq templates. They're generated from your database just like the ActiveRecord templates but give you POCOs instead.
Alternatively you can just use the simple templates and never run migrations, migrations only happen when you explicitly tell them to (by specifying SimpleRepositoryOptions.RunMigrations while creating your repository) so it's not so much that you need to turn them off, just don't turn them on.
Is it possible for subsonic to access dbo.sp_help_job?
SubSonic is an ORM tool that also wraps SP's but does not generate code for system SP's and the project is open source so you can edit the code to your need