Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Browsing all 1698 articles
Browse latest View live

EF bulk insert and update without hitting db repeatedly

suppose i have many employee data strored in list<emp>. now few data is new in list and few updated. so tell me best way to bulk insert and update without hitting db repeatedly with...

View Article


Entity Framework Grouping By Year And Month

i hardly use EF so not string in it.code taken from https://www.mikesdotnetting.com/article/257/entity-framework-recipe-grouping-by-year-and-monthpublic ActionResult Index() { var context = new...

View Article


Web API

I want to use a Web API to populate a select element using the entity framework as my datasource and mvc as my framework. Thanks ! Also I was wondering why would it be a best practice to use a Web API?...

View Article

Web Api and repository pattern

If I am using a web api to fetch data should I be using a repository pattern  for my web api? Thanks !

View Article

Image may be NSFW.
Clik here to view.

Hierarchical Data Management with EF

just read article from this link https://www.mikesdotnetting.com/article/255/entity-framework-recipe-hierarchical-data-managementwhy menuitemid column is required in table. if i develop the same table...

View Article


excel without formatting in cells

Hello. I am using somthing like this to import excel to a dataset ("provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + TextBox1.Text + "';Extended Properties=""Excel 8.0;IMEX=1""") This has an issue...

View Article

Receiving NHibernate with MySQL Syntax error during table creation in C#

hi,I am new to NHibernate, while doing simple crude operation with NHibernate and MySQL database, I am getting error as:You have an error in your SQL syntax; check the manual that corresponds to your...

View Article

Receiving GenericADOException while using NHibernate 4.1 with MySQL Database

Hi,I am new to NHibernate, while using NHibernate with MySQL database I am getting error at  transaction.Commit().Error:NHibernate.Exceptions.GenericADOException was unhandled HResult=-2146232832...

View Article


Reuse of models

What if I wanted to reuse a model that populates all select elements in my mvc web application. I don't know if anyone has heard of module Model View Control where all models and views are put in two...

View Article


Making effective db calls (reducing number of trips to db)?

I have some code that sends many individual calls to the db in order to populate data in one viewmodel.I have one Company entity. It has Meetings and Plans as collections. I don't want to include all...

View Article

Code to call stored procedure

Greetings all, please I need a code for calling stored procedure in MVC. Thanks in anticipation and regards .

View Article

Model Updateability

Kinda new to EFMy boss is expressing concerns about how updating our database' schema might effect the EF models we have.Example:  We create a view and bring that into the EF model.  Somewhere down the...

View Article

Linq to SQL and Stored Procedure

  I am using Linq to SQL. Below is the code I am using. As you can see I am using a stored procedure and passing it an integer but yet q, the inferred type variable contains nothing after this code is...

View Article


How return number of rows affected by session.save in NHibernate C#

Hi,Can anyone tell me how to return number of rows affected by insert or update query in NHibernate. I am using Repository pattern. DataRepository Class:using System; using System.Collections.Generic;...

View Article

Function that returns the results of a linq query.

I was just wondering what is best practice for writing a function that returns the results of a linq query. What should be the type of the function? Thanks for any advice anyone can provide.

View Article


Disregard - was Custom Class to EF mapping

Went with a solution that makes OP mootsorry :-(MODS:  can you guys delete this thread?

View Article

Recursive Efficiency!

Hi all,I'm trying to speed up a hierarchical tree builder with LINQ, this is what I have but it takes ages for trees that are thousands deep! Any tip on speeding this up at all?void...

View Article


How to insert a Parent along with it's children in EF Core

In my ASP.NET Core 1.1.1 MVC web app, the Intellisense of the code editor of VS2017 does not recognize .child at line p.child.Add(c1);. What is the correct way of adding a Parent along with it's...

View Article

Difference between EF and dapper

i am looking for few good points which clearly tell me difference between EF and dapper. so give me some points with sample code which show the difference in terms of code between EF and dapper.

View Article

StackOverflowException when including a navigation property

I have a collection of ProjectMissingPeople as a navigation property on Project. When I try to include them when passing a list of Project to a view, I get a stack overflow exception. Do you know how...

View Article
Browsing all 1698 articles
Browse latest View live