Creating MVC 4 data access layer using SQL Server 2000 - asp.net-mvc-4

I am a novice ASP.Net developer/student/intern. Currently, I am in the process of creating my first MVC web app with:
VS 2012 Ultimate C#
SQL Server 2000
My database is on a SQL Server 2000 with no chance of upgrading to >= 2005 in the foreseeable future. Thus preventing me from using EF, which all the books and examples I’ve read so far have used.
I have created a C# SQL helper class for connections, commands etc. that I have used previously as a data access layer for other basic web form applications.
What's the best way to incorporate it into my current MVC DAL?
Also,are there any examples or documentation outlining the basic steps in creating a sound MVC DAL that adheres to MVC best practices while using server 2000 and without EF.?
Any suggestions/guidance would be greatly appreciated.
Thank you,
Todd

Technically speaking, MVC has nothing to do with your DAL. As far as your MVC app is concerned, it shops at the repository layer and does not care what happens in the warehouse (data layer).
Your DAL can be built using ADO.NET. Although this technology is old, its perfectly usable. If you check out http://www.dofactory.com/Default.aspx, you will see an app that is build using multiple DAL technologies. One is for Entity Framework and another is for ADO.Net ... and the cool part is they are BOTH hitting the same database.

Related

How can I connect to an external SQL database using Blazor without using packages (like Entity Framework)

I'm not even sure if this is possible but Google has been unable to help me. It may just be because Blazor is so new. Anyway, I've got a premade database and I want to connect to it directly like how you can open a connection, run some SQL, then close a connection in ASP.NET. I, unfortunately, can't just make a new database using code-first as most tutorials tell you to do.
Two options that spring to mind is the Entity Framework Core (Database First) or Dapper.
I'm actually connecting to an existing database using Dapper in my Blazor projects and there are better Dapper examples/tutorials available however the below is a basic example.
https://github.com/DotNetDublin/BlazorServerSide/tree/main/BlazorServerSide
If you don't want to use either Entity Framework or Dapper you can use ADO.NET.
The below tutorial is for MVC however the code for interacting with the database would be the same. See StudentDataAccessLayer.
https://www.c-sharpcorner.com/article/crud-operations-using-asp-net-core-and-ado-net/
use the ef command Scaffold-DbContext

Using MVC4, need to pass input to stored procedure in SQL Server 2012 and retrieve the result and display it in view

I am new to the MVC concepts, I need to learn it quickly before my new project begins in a couple of weeks. I just want to know one thing, how to pass an input to a SQL Server 2012 stored procedure using Entity Framework and retrieve the results and display it in view using ASP.NET MVC 4.
If some one help me to do this it would be grateful, I can move on learning this basic steps.
thanks for your time.
This question isn't so simple and better to answer it with links to articles:
Work with Entity Framework in ASP.NET MVC 3/4
Stored procedures in the Entity Framework

Windows 8 Databound App Tutorial

Does anybody know of a good tutorial, preferably with downloadable sample code, for a Windows 8 app that is data oriented?
I am trying to rewrite a fairly simple Windows Forms application, which uses a local SQL Express database, as a Modern UI Windows 8 app, but it seems that Windows 8 apps don't support accessing SQL databases natively. This leaves me wondering what the best way to store the app's data is, and also lost as to how to handle calls to create/edit/delete records, etc.
I've come across the Reversi sample app, which Microsoft claims contains extensive examples of databinding, but actually it all seems to be in an MVVM context, binding visibility of controls, positions of items, etc. I'd like to see an example of a more traditional, simple database application with records that can be browsed, updated, created, deleted, etc. Not least so that I can just see how the data is stored, since an external database apparently isn't an option!
You can use SQLite as database for Windows Store App. There are couple of articles & code sample available.
SQLite samples from MSDN
Using SQLite in Windows 8 Store Apps
WinRT app guide: Step 10: Adding a lightweight database (SQLite) and CRUD support + two-way element binding

Accessing SQL Server 2005 from Silverlight 4?

If i am using Silverlight 4 and WCF to access my SQL Server 2005 DB - is it going to be a problem? Do i have to use SQL Server 2008 /R2 to do that - or will EVERYTHING work the same (i am making sure because irecall reading somewere that SL4 & RIA works only with SQL Server 2008/R2).
P.S
if you have a better way (a more direct way) to access SQL DB without the use of WCf(=RIA) it will be even better.
Because Silverlight is client-side, it uses only WCF to connect to data sources. That means that it really doesn't matter what version of SQL you are using relative to what version of Silverlight you have. The two are not connected directly. This allows Silverlight to do what it does best (display and gather data and do other UI "stuff").
WCF, on the other hand, can use almost any data source you can dream of using. It can pull from MySQL databases, SQL databases of all versions, and basically anything else that it can connect to via code.
RIA is built on top of WCF so there are some limitations on RIA. There is a question that goes through this in some more detail: RIA Services Vs. WCF and Shared Code
So, the simple answer to your question is no, using SQL 2005 will not be a problem and no, there isn't a more direct way to connect Silverlight to your SQL database.

Reporting Services 2005 Model using WCF Service for data

I am trying to use WCF Services as models for SQL Server Reporting Services 2005 reports. I can do this if I design the reports in the designer but cannot do it for a Reporting Model project which I think I need to make reports in the Report Builder.
My full requirement is to have a report builder that the users can use building reports based on DTOs supplied from my WCF service.
Thanks
Turns out you can't do this.
I've gone for Dex Express XtraReports which seem to be more powerful. I'm using their designer components to make a Report Designer application - which I shall customise to integrate completely with the application - save/new/edit all handled by my code should make the experience more pleasent for the user.
It seems SSRS just isn't ready for user designed reports based on .NET objects yet.