I have a SQL query need to do in LINQ. Can anyone helps in converting? SELECT * FROM profile WHERE ProfileId <> 1221 AND IsActive = 1 AND ProfileId NOT IN (SELECT ReportingPerson …
Tag: linq
choose a few id from db C#
I have a database and excel file And I want to export strings to excel How to export strings with 1 id I know The code you can see below _Hours = Rep.Where(o => o.Projects.ProjectGroupID == 4)….
Only returning one record in dataset
I am using ado .net in my web API and dapper and I have a function that checks the orders and the order lines it works fine if their only one order but if there an order without order lines it won’t …
SQL OR Linq: How to categorize into different batches when category changes
I have the following data: Timestamp Min MAX Category 2019-03-22 08:10 12.00 5.10 AAAA 2019-03-22 08:11 10.00 5.20 AAAA 2019-03-22 08:12 11.00 4.90 AAAA 2019-…
How can I get rid of having to prefix a WHERE query with ‘N’ for Unicode strings?
When searching for a string in our database where the column is of type nvarchar, specifying the ‘N’ prefix in the query nets some results. Leaving it out does not. I am trying the search for a …
Select most recent row filtered on multiple columns
I have an sql table +——+———–+———–+——–+————–+ | rowID| location | fk_Item_ID |Balance |Inventory_Date| +——+———–+———–+——–+————–+ | 1 |…
How To Convert Linq To Sql?
I want write code for table, I know in SQL Server, but I don’t know Linq or EF. SQL Server code: SELECT * FROM Driver WHERE id IN (SELECT Driver FROM Drive_Car WHERE …
Select one of each matching results from group last record from date
I have multiple customers that are a part of a group designated by a group id. I would like to retrieve 1 record from a related table for each of the matching group members (last record before a …
Join multiple tables and single output using Entity Framework mvc5
I am very new to linq query so I need to join multiple tables and single output using Entity Framework mvc5 Below is my 3 table structures and Table_Application is a main table 1) Table_Application …
LINQ Room id where user exists
I have two tables: ChatRoom Id (int) ChatUser (where i insert the users to the chat room, 1 row per user) RoomId (int) // Id from table ChatRoom UserId (int) I want to loop out all rooms where im in i do like this. But how do get the room id where the second user with the variable userId2 exists?