Skip to content

Instantly share code, notes, and snippets.

View itorian's full-sized avatar
🎯
Focusing

Abhimanyu Kumar Vatsa itorian

🎯
Focusing
View GitHub Profile
@itorian
itorian / EntityFramework vs LINQ vs ADO.NET - select query samples
Created December 3, 2015 11:24
EntityFramework vs LINQ vs ADO.NET - select query samples
// Entity Framework
public ActionResult GetBokaroStudentEF()
{
var db = GetFromDbContext();
var data = db.Students.Where(i => i.City == "Bokaro");
return View(data);
}
// LINQ
public ActionResult GetBokaroStudentLINQ()
@itorian
itorian / AngularJS CRUD in MVC Sample Demo
Last active December 3, 2015 10:58
AngularJS CRUD in MVC Sample Demo
Step 1. Install AngularJS using install-package angularjs or using NuGet Package Manager
Step 2. Insert JS code references on web page or _Layout.cshtml page
<script src="~/Scripts/jquery-1.11.1.min.js"></script>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/AngularImp/EnquiryService.js"></script>
<script src="~/Scripts/AngularImp/EnquiryCtrl.js"></script>
Step 3. Create View Page as given below
@itorian
itorian / Default.aspx
Created March 7, 2014 08:15
Code snippets to connect Microsoft Access Database (Office Access) : Checking user availability (custom login) and selecting data and saving data.
<script>
function SaveMember() {
var ID = document.getElementById('<%=hfID.ClientID %>').value;
var OrderStatus = document.getElementById('<%=ddlOrderStatus.ClientID %>').value;
var PaymentStatus = document.getElementById('<%=ddlPaymentStatus.ClientID %>').value;
var DispatchDateTime = document.getElementById('<%=txtDispatchDateTime.ClientID %>').value;
var CourierCompany = document.getElementById('<%=ddlCourierCompany.ClientID %>').value;
var ConsignmentNumber = document.getElementById('<%=txtConsignmentNumber.ClientID %>').value;
var DeliveryDetails = document.getElementById('<%=txtDeliveryDetails.ClientID %>').value;
var Status = document.getElementById('<%=ddlStatus.ClientID %>').value;
@itorian
itorian / Download.cshtml
Last active August 29, 2015 13:57
Upload File (Single file at once) to SQL Server Database from Index.cshtml view page and download them from Download.cshtml view page. If you want to upload multiple files once read this gist https://gist.github.com/itorian/9389738
@model IEnumerable<MvcFileUploadToDB.Models.FileUploadDBModel>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Upload New", "Index")
@itorian
itorian / Download.cshtml
Last active August 29, 2015 13:57
Upload Files (multiple files once) to SQL Server Database from Index.cshtml view page and download them from Download.cshtml view page. In the previous gist we saw code to upload single file at once here https://gist.github.com/itorian/9385989
@model IEnumerable<MvcFileUploadToDB.Models.FileUploadDBModel>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Upload New", "Index")