Skip to content

Ado.net ORM with SQL server in C#, Whenever you start your .net project and need to connect your SB with secure access, download it.

License

Notifications You must be signed in to change notification settings

brijeshp1993/MyORM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyORM

ADO.Net and SQL server

  1. Create new database connection object using
using (var dbConnection = ConnectionFactory.CreateConnection(connectionString))
{
    // database operations
}

OR

using (var dbConnection = ConnectionFactory.CreateConnection())
{
    // database operations
}
  1. where connectionString is string object which has value of connectionstring for database, or it will take default connectionstring from web config. Name of the default connectionstring must be "DefaultConnection".

Methods for text Query

  • dbConnection.ExecuteSingle(); // with/Without Mapper
  • dbConnection.ExecuteList(); // with/Without Mapper
  • dbConnection.ExecuteNonQuery();
  • dbConnection.ExecuteScalar();
  • dbConnection.ExecuteNonQueryWithScope(); // with return parameter

Methods for Stored Procedure

  • dbConnection.ExecuteSingleProc(); // with/Without Mapper
  • dbConnection.ExecuteListProc(); // with/Without Mapper
  • dbConnection.ExecuteNonQueryProc();
  • dbConnection.ExecuteScalarProc();
  • dbConnection.ExecuteNonQueryProcWithReturn() // with return parameter, Name of the return parameter must be "ReturnValue"

Methods for transaction

  • dbConnection.BeginTransaction();
  • dbConnection.CommitTransaction();
  • dbConnection.RollbackTransaction();

Other Methods

  • dbConnection.GetConnectionString();
  • dbConnection.GetOutParameters();
  • dbConnection.Dispose(); // dbConnection object will be automatically disposed as it inherits IDisposable.

About

Ado.net ORM with SQL server in C#, Whenever you start your .net project and need to connect your SB with secure access, download it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published