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

Cascade delete entitiyframework core

I'm a bit confused about this. So By convention, Entity Framework enables cascade delete for non-nullable foreign keys and for many-to-many relationships. if I have a foreign key on one table called...

View Article


Getting SUM of column and group

Hi all. I have 2 tables (tblGenerator AND tblGeneratorLine). tblGenerator contains ingormation about each generator, and the tblGeneratorLine contains the rent per month per generator. I want to get a...

View Article


ADO.NET entity data model - problem with foreign keys

Im using the ADO.NET entity data model wizard to create a bunch of POCO's from my database.  I choose the code first from database option, then select the tables i require.  The 'include foreign key...

View Article

EF error when returning from Stored Procedure in EF 6.1.2

When I am calling a stored procedure I am seeing this error:Additional information: The data reader is incompatible with the specified '.sp_MySp_Result'. A member of the type, 'Column1', does not have...

View Article

Efficient way to be update grand child records in c# using LINQ

I have to update a column 'PPMOProjectID' in the table, but in such way that if it is empty and tricky part is I have a scope of only parent child relation ship in the table like if MP- master parent,...

View Article


Image may be NSFW.
Clik here to view.

Database objects are not in my Entity

Hi All,I started using Entity framework with web forms. For that I have created an entity. My entity's name is MIS.Below is my .edmx diagrame.The problem is neither I am able to access my namespace nor...

View Article

Error-There is already an open DataReader associated with this Command which...

Hi Below is the codefunction FillCity() { var stateId = $('#StateId').val();$.ajax({ url: '/Customer/GetCity', type: "GET", dataType: "JSON", data: { StateId: stateId }, success: function (cities)...

View Article

Entity Framework in one project but on 2 solutions

HiI have an entity framework project in my solution which is a CMS, and I also have a solution which uses the same project, using Add Exisiting Project.Everything works fine on the CMS project, but...

View Article


SQL Query to LINQ

Hi guys,Please assist in converting the sql query below to Linq query. Many thanks.select SalesRep.FirstName, Business.BusinessName, [Month].[MonthName], [Year].YearName from TargetHead inner join...

View Article


Convert or map/add Entity Framework Stored Procedure Result Set records to...

Hi there,I have stored procedure which I have imported in EF and its returning n number of records and its return type is  ObjectResult<spGetProductData_Result1> this result set I am storing in...

View Article

Compare 2 entity items

Not sure how to subscribe this, but I need to compare 2 items in a where clause, but 1 that comes from another joinI placed a comment after the where clause and after the join that the data item come...

View Article

customize a sql command in foxpro c#

/* Microsoft SQL Server Integration Services Script Task Write scripts using Microsoft Visual C# 2008. The ScriptMain is the entry point class of the script. */using System; using System.Data; using...

View Article

Entity Framework:- Violation of PRIMARY KEY constraint . Cannot insert...

HelloI am inserting new data in a few different tables with the same data from my main table, but after inserting say 4 or 5 records I get the above error for one of the tables, here is my codepublic...

View Article


Not Sure On Approach to Take

I have a modelpublic class ClientContact { public int ClientContactID { get; set; } [Display(Name ="Client")] public int ClientID { get; set; } [Display(Name = "Contact Name")] public string...

View Article

How can I hide certain fields when accessing database from DbContext

In my database I have relations, for example, I have a table like:CarId, Model, Manufacturer, Owner where Owner is a foreign key to another table. I have a DbSet<Car>How can I select all columns...

View Article


materialising hierarchical data into custom dto's

I have 3 tables in a master detail relationship and I want to materialise data into a set of custom dtos' but I cant get it to work, heres my linq statementvar overView = await (from organisation in...

View Article

retrieving data from multiple nested table levels

I have a master table with a detail table linked by a foreign key (integer), this detail table then has its own child table again linked by a foreign key (integer).  So I have 3 levelsIn my LINQ quey I...

View Article


EntityFramework unable to insert data into SQLServer table

Hi, As above,error Msg :System.Data.SqlClient.SqlException: Cannot insert explicit value for identity column in table 'Customers' when IDENTITY_INSERT is set to OFF. in SQL Server table, I have...

View Article

Image may be NSFW.
Clik here to view.

Load data from one form to another on a grid

good afternoonLords programmersIf someone can guide me please I am making a sale application for warehouse, with rod bar works that part when pistolear load the products on the grid okSearch code...

View Article

How to group Northwind orders based on Customer ContactName

Im using northwind database . U may see the attached files .My view displays all orders from the database without an order . I want to display orders based on contactname (customer) and alphabetically...

View Article
Browsing all 1698 articles
Browse latest View live


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