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

Unable to resolve service for type 'ClassLibrary.ApplicationDbContext'

I have added a Class Library to my solution so that I can use Work Authentication on my ASP.Net Core site. I have been able to add a migration and update database from the PM console. However i am...

View Article


creating an ef query on an array

I have a Poco class called Product. I also have an array which contains ids of Products which I would love to find. I want a way I can write a single query that would help find Products based on the...

View Article


Throwing Errors System.InvalidOperationException No service for type and...

I know I have made this issue.  I was having issues with my project.  Mostly in the migrations as I had stuffed it up.  That's fine I am new to this.  I forgive myself.To fix this.  I decided to create...

View Article

sending DataReader to IEnumerable

What is the best way to send the Datareader to IEnumerable <TABLE> model view page?

View Article

How to return multiple result set from EF query

when we use inline sql then we can write sql in such a way as a result it return multiple result set hitting db once time. for exampleselect * from department;select * from employeehere i use semicolon...

View Article


EF Exception:The context cannot be used while the model is being created

I'm trying to crate database depening on class variables.My classes are defined asusing System; using System.Collections.Generic; using System.Linq; using System.Web; namespace...

View Article

EF-6 Code First Table Valued Function

Hi,I have built an Entity Framework-6 using Code first and I created a Stored Function which returns a table in the MS-SQL  database.  How will I be able to reflect the Table-Valued Function in Entity...

View Article

Return type for Linq Query

I have a service where by i would like to call the function below. And for the life of me I cant work out what the correct return type should be. I DONT want to create a object class that has the the...

View Article


mapping domain entities to dto's

I have a complex dto that consists of records from 4 tablespublic class AggregateDto {   public OrganisationDto Organisation { get; set; }   public List<Meter.MeterDto> Meters { get; set; }...

View Article


Image may be NSFW.
Clik here to view.

NuGet is causing compatibility issues inside my asp.net mvc project when i...

I have the following:-Visual studio 2012 professional. Asp.net MVC 4 web application. 2 .EDMX files representing 2 SQL server 2008 r2 databases. Now my asp.net mvc web application was working well. but...

View Article

Data from a SQL Database

Hi Folks,i have a SQL (Express) Database and I like to use it in my MVC Web App. Sorry, all for me is new. I´m learning building up websites. The normal way I connect into my database, is with username...

View Article

SQL column not found when using parameters.

Hello,I have the code below to look up a user name.  I am trying to use parameters to strengthen against SQL injections.  When I run the code below, I get the error:  ERROR [42S22] [IBM][System i...

View Article

Is EF Necessary?

Hi!I'm (finally) moving from WebForms to .Core.I'm using a current project from work as a test. This project is using a 3rd party SQL Server database.  It's rather large and complicated, and when one...

View Article


How to include Data from Table Above

Not quite sure how to explain this please bear with me.I have a table Client.Table Client has a relationship one to many with Sites.Sites has a relationship one to many with Jobs.In Jobs I want to add...

View Article

populating drop down list using EF6

I am trying to upgrade my site to asp.net.identity, but having problems almost every step. I have a simple drop down that just displays a list of states for the user to select from. There are several...

View Article


Relationship between 2 classes

Hi  I have 2 classes . How i can create CountryId as Foreign Key in States Classpublic class Country { [Key] public int CountryId { get; set; } public string CountryName { get; set; } } public class...

View Article

DbContext.Create()

I am new to Entity Framework & trying to learn, have a basic question. Can we create another DbContext.Create() before savingChanges to already existing Context??

View Article


Problem in Linq query with lamba expression

i try to fetch all employee from tblEmployee table based on department name where depart_ref_id and emp_ref_id is stored on tblEmpOffInfo1- tblEmployee.cspublic class tblEmployee { public int ID { get;...

View Article

Stored Procedure to get one on in a row on a grid

How could I write a store procedure to get one cell in a row on a grid?

View Article

How to manually define DBContext code snippet for table without primary keys?

Hello,I followed these instructions ( https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db ) to automatically create database models/entity classes and the DBContext class,...

View Article
Browsing all 1698 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>