Asp.net Web API With No Entity Framework - asp.net

We want to start using Asp.net web api for our future enterprise services however we do not want to use EF for data access.
Are there any samples out there for Asp.net Web APi working with regular ado.net classes instead of EF?
Thanks.

Are you looking for code samples for how to use e.g., SqlConnection, SqlCommand, SqlDataReader?
You would use the classes in System.Data.SqlClient if you are trying to talk to SQL Server, System.Data.OracleClient if you're trying to talk to Oracle, or System.Data.Odbc if you're trying to talk to MySQL.
Here are some code samples for how to call a stored procedure from ADO.NET. Good luck!

Related

Using Owin with ado.net

I am working on a project on ASP.Net with MVC and using ado.net instead of Entity Framework (i mean, all communications with DB done with stored procedure and followed n-tier architecture). Is there any possibility to use OWIN for security and authentication using ado.net?
if not...then suggest any other reference for implementing security and authentication with ADO.Net
you have to implement IAuthenticationManager interface, and write your corresponding services which calls the ADO.Net codes in there.
Rick Strahls article explains well enough.

Difference between Entity Framework and Microsoft SQL Server

I'm fairly new to mvc, asp.net, and .net framework in general.
I understand what models are, controllers and views, but what I don't get it is Entity Framework. I developed websites before using php, and when I needed to store some data I simply do that using MySql databases. I thought this is the case with asp.net, same concept but instead of MySql, Microsoft Sql server is used. Now I started to learn .net framework and I watched a lot of online tutorials and saw them using some classes inherited from DbContext to store data! Can anyone tell me where these classes store the data and why don't we use Microsoft Sql server instead?
Entity Framework is an Object Relational Mapping tool (ORM), a layer that sits between your database and code. The idea is that the ORM is database agnostic and will handle writing the SQL for you, so that you could (in theory) swap between SQL Server, MySQL, or whatever database you want with only configuration changes.
You can skip Entity Framework and use SQL directly with ASP.Net. Your tutorials just happen to use Entity Framework.

Best method for using Entity Framework with web services

I have a legacy ASP.Net web application that is basically used to process web services.
I am adding some new functionality and would like to start using EF4.1. I'm fairly new to EF, and I'm not quite sure the correct path to take here.
The client using this web service is a Linux based client running Apache, so data will be passed back and forth using SOAP.
My question is, what is the best practice for getting EF models into and out of a SOAP data class? Would using EF POCO classes be the best for this?
You could use the Entity Framework for data access with either a ASMX or WCF web service that will use SOAP.
Using Entities with Web show give you some direction and ideas.

How to integrate an oracle database with an asp.net web application?

How to integrate an oracle database with an asp.net web application?... Any good tutorial to start with?
This link might help you:
In this article, I'll explain the basic yet essential processes
involved in building a C# or Visual Basic .NET application that uses
an Oracle database, including:
How to add project references to support Oracle class libraries in your .NET project
How to create Oracle Database connection strings
How to work with Connection, Command, and DataReader objects

database for vb.net and asp.net

is it possible to use same database for both vb.net appplication and asp.net??
and if is possible, how can to connect it???
now..i'd build vb.net application and asp.net in my laptop...
it can connect..but i wonder how to make the database connect for vb.net and asp.net in real...
thank you in adnvance
Short answer... Yes.
Databases are meant to be shared by many different applications as well as many different types of applications.
For VB.net and ASP.NET (in the code behind), you can use the same code to access the database...
Using _conn as New SqlConnection(connectionString)
'Do Stuff'
End Using
For databases to use for free, you can get MS SQL Express edition, Oracle XE, MySql, and a few others.
If you write your data access layer (DAL) as a web service (or WCF application) then both your ASP.NET site and Winforms app can call the DAL and have access to the same data in the same database.

Resources