|
ADO.NET Data Services Logical Operators
In this post we will look at Logical Operators in ADO.NET Data Services. These operators can be used as filter expressions in our requests and ADO.NET Data Services applies the filter before results are returned. We will use Data Services generated over Adventureworks Lite database. If you are new to ADO.NET Data Services and would [...]
Execute Stored Procedure With ADO.NET Data Services
Introduction
In an earlier article I looked at how DO.NET Data Services can be used with ASP.NET. In this post I will talk about using ADO.NET Data Services to retrieve data via SQL Server stored procedure. Doing this is simple and I will follow a similar approach to hook everything up as I did in my [...]
ADO.NET Data Services With ASP.NET
Introduction
In this tutorial we will look at how ADO.NET Data Services can be used to create services which are consumed by ASP.NET client. We will use Adventure works Lite database as an example to demonstrate the concepts. Code for this article can be downloaded at the bottom of the article.
ADO.NET Data Services as the name [...]
Insert Master Detail Data With LINQ To SQL
Best thing about running One .Net Way is interaction with members of developer community. I thoroughly enjoy answering questions which come my way through this site. Early in the morning today I saw a question by Joey. To avoid loosing details in paraphrasing, here is the exact question asked by Joey.
I’m new to LINQ. If [...]
Select Max Value With LINQ To SQL
Today I was asked a question by a developer on my team. The question is “How do you select MAX value for a column in a table with LINQ To SQL?”. I will try to answer the question in this post with an example. Let’s say that we want to retrieve maximum unit price from [...]
Create T-SQL CASE Statements With LINQ To SQL
I was recently helping Nosh with a LINQ To SQL query where he wanted the resulting T-SQL query to have CASE statements. Having CASE statements in T-SQL queries is a common scenario but how do we it in LINQ To SQL .After some investigation I found the solution which I am presenting here using an [...]
Get Last Row From Table Using LINQ To SQL
This query returns the last row from Sales.Customer table in Adventure Works database. I am using LINQPad to write and execute my query.
(from c in Customers
select c)
.OrderByDescending(x=> x.CustomerID).First()
Here is the result as displayed in LINQPad
LINQ Equivalent Of Where IN With Int
Earlier I wrote a post showing how to write a LINQ query which gets transformed into a T-SQL query with a "Where In" clause. I had a comment on the post by Steve saying that the approach only works with strings. In this post I will show you a similar query which works with Integers.
Let’s [...]
LINQPad with Intellisense
I had a look at LINQPad few months ago when I wrote about how you can use this tool to view generated LINQ To SQL Queries. There is not doubt that LINQPad comes in as a very handy tool when writing LINQ queries. But writing queries in LINQPad has not been that easy. Until Now!
LINQPad [...]
Remove Duplicate Lines From A Text File Using LINQ
A question was posted on c-sharpcorner forums asking how you would remove duplicate lines from a text file. It got me thinking about how this problem could be addressed using LINQ. Before I get into the solution, here is the problem statement.
The problem
I am trying to remove duplicate lines from a text file. To [...]
Dynamic Sort With LINQ To SQL
Sometime ago I wrote a post showing how to do dynamic sort with LINQ. That approach worked well with LINQ To Objects. Today I spotted a question on the forums where Levi asked a question about doing dynamic sorts with LINQ To SQL. My earlier approach will work once all the data is retrieved on [...]
Enum Support With LINQ To SQL And SqlMetal
As a programmer I love my enums. I find code written using enums to be more readable than without them. However, there has been and there still is a disconnect between lookup tables in a database and enums in code. One has to restore to some creative trickery to get them working in harmony. Recently [...]
Get Updates By Email
Popular Post
Tag Cloud
Code Snippets
- Get Current Windows User In C#
- Get Width And Height Of Image In C#
- Get Windows Registry Size With WMI And C#
- Reverse Array Elements Using C#
- Convert Hexadecimal To Number In C#
- Get Free Disk Space Using T-SQL
- SQL Server 2008 – Get All Indexes In A Database
- Get Name Of Current Executing Assembly In C#
- Get CD Or DVD Drive Information Using WMI And C#
- Get Last Row From Table Using LINQ To SQL

