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

Column Summing using Linq

I need to do column summing of datatable. Datatable example as given bellow -Datatable(dtrec) COL1 COL2 COL3 ID AMT PERCENTAGE COL4...

View Article


NativeQuery vs StoredProcedure

HiIn some web pages there are comparation s between: NativeQuery vs StoredProcedure in connections to the database such as :http://www.luisrocha.net/2011/12/data-access-performance-comparison-in.htmlI...

View Article


Does Linq use more bandwith than a store procodure?

HiWhen I use linq, I see in sql profiler than a big query is executed...exec sp_executesql N'SELECT [GroupBy3].[A1] AS [C1] FROM ( SELECT COUNT(1) AS [A1] FROM ( SELECT [Project3].[C1] AS [C1], CASE...

View Article

Trouble with CF entityframework migration (Principal Ends)

Hi, In my scenario, I am trying to apply CF EF migration to create my tables in DB from entities. The following error shows up when I run add-migration.Unable to determine the principal end of an...

View Article

I Need To Display fetch data in random in my Table

Hi In my Mock_Test Table Number of Questions is There I need to select Question Randomly...I try to fetch DO like this using (Models.EOTAEntities dbModel = new Models.EOTAEntities()) { if...

View Article


Split datatable based on row count and create new sheet and export to Excel

Hi.I am trying to export data from dataset to Excel 2003 version ( C#, VS 2010, ASP.NET Web Application ) . By default, excel can take 63000 rows in a single sheet. Post that, there will be out of...

View Article

Linq with jagged arrays

I am trying to understand a piece of code but I am not sure I do. I will be very grateful if someone could explain to me what happens here:foreach (var row in jaggedArray.Skip(1).OrderBy(r =>...

View Article

C# Linq Subquery (NOT IN)

I have three tables and I need to join TableA and TableB WHERE ID NOT IN TableC.  Can someone help me with my subquery please.....Thank you

View Article


Error Message

Hello Friends,I was wondering has anyone ever got an error message that states The semaphore timeout period has expired? If so what exactly does that mean? Thanks !!!Server Error in '/' Application....

View Article


Error SingleOrDefault not helping

my project in raised error "Sequence contains more than one element"Project rd = this.db.ProjectSet.SingleOrDefault(x => x.pid == Id);i think avoid exception

View Article

I can't write my SQL query in Linq and EF

Hi all,I need to convert this pseudo SQL query into LINQ EF version.In MyFirstTable Find the rows whose MyField contains "MyProduct" string then join MyFirstTable with MySecondTable using...

View Article

This overload of the method 'System.Linq.Queryable.TakeLast' is currently not...

I have an ASP .Net Core 2.2 Web API using Entity Framework Core. It connects to a MySQL database using the latest version of Pomelo. When I try to execute the Linq function "TakeLast", like this:var...

View Article

Linq vs Pure SQL in EF, (is it safe and fast to use Pure sql)

Hi all,As far as I see you can do anything you want using .FromSql in EF. However, is it safe and fast usage of pure sql instead of link (as long as you use the right sql approach).Even I am thinking...

View Article


SQL Statement Where DateTime Equals GETDate()...

How do I convert the following statement into a C# MVC Linq statement?SELECT * FROM tablenameWHERE RecordID = 200 AND EmployeeID = 3 AND Cast(CreatedDate as DATE) = (CAST(GETDATE() AS DATE)It works in...

View Article

Model First approach in entityframework core

Hi,Can any one please guide me that is there Model First approach in entityframwork core. Please try to help with some reference of authentic materials.Thanks

View Article


Confused by Inheritance and EF Core

I'm trying to learn EF Core and I've got myself confused about how inheritance works with the code first implementation.  I've created by code first classes e.g.Class 1 - Card (has a number of fields...

View Article

fetching data from one to one table to parent tb

Hi,I'm fairly new to linq. I am having trouble with a query that i suppose is very easy but i'm not sure how to do it.i have a class that holds all the data(named PersonData). this data comes from two...

View Article


Entity Framework Core and Inheritance

I've got a more complex EF Core problem.  I have a class Card which is the base class (objects can exist of this type) and class SpecialCard (objects can also exist of this type as defined below. At...

View Article

Could someone help me out with this Linq query?

New to Linq and was wondering if someone could someone please help me out with this linq query. The "test2" seems to just return the number of items regardless if the "Status" is filtered. Am I doing...

View Article

Using a xref table to filter results

I have 3 entities.  Hotel Airport HotelAirportXrefI am trying to pull back a list of hotels linked to a specific Airport.  Simple in SQL , just my first time doing with EF and LINQ. VM._Hotel =...

View Article
Browsing all 1698 articles
Browse latest View live


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