Skip to content
Advertisement

Tag: linq

LinqToSql OrderBy has no Effect

I am using a LinqToSql-DataSource for a GridView in this way: Now i want to order the Selection. At first the “stammVerein”-Column of Table “mitgliedschaft” descending AND the Column “eintritt” of Table “mitgliedschaft”. I have tried several ways: AND: AND: But nothing of this has any Effects ! I am very new in this kind of DataSource and Linq. Can

Linq tolist() count returns different value from translated sql

I have a situation where the translated sql direct form Visual Studio is returning a different number of records from the Linq. I am expecting 4 items but in the count() of the resulting list I only have 1. This is the case despite creating more records – it always returns 1. Strange thing is I have the same linq

Filter and Match Column on a List of Substrings

I am attempting to filter a table of user actions on a list of specific actions. For example, given the following data I want all rows where the UserAction contains the strings “Account Creation” or “Attempt to create duplicate account”. I was able to achieve this with the following Linq, but the query’s performance caused the webpage to timeout and

SQLDateTime OverFlow with Correct DateTime Format

below is my code snippet where I insert a DateTime value to SQL database and encountered the following error: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. May I know if there is a format to be used? when converting the value of row.DeliveryDate? Answer actually the problem is SQL DateTime =/= C# Datetime you

Advertisement