Browse by Tags

All Tags » SQL Server (RSS)

LINQ to SQL and MS Small Business Server 2008 Talks at .NET Valley by Jason N. Gaylord's Blog

The next .NET Valley User Group event will be on June 18th at Scranton University in Scranton, Pennsylvania. There will be two talks that evening. The first will begin at 6pm and will be presented by Michael Murphy. Michael will talk about the ins and...

Performance Tip: Return Only Necessary Columns Using LINQ by Jason N. Gaylord's Blog

I was running into an issue where one of my webmethods was taking a large amount of time to return a small set (5-10 objects). I was using LINQ to SQL. I noticed that the LINQ to SQL query was returning all of the rows. After looking into the table a...

A circular reference was detected while serializing an object of type 'XXX' by Jason N. Gaylord's Blog

I ran into an issue earlier when trying to return an entity class through a web service for use in an AJAX page. After some quick research, I came across a post by Darren Neimke that referenced Rick Strahl's post about LINQ to SQL and Serialization...
Filed under: , ,

Retrieving SQL Type Image Using LINQ by Jason N. Gaylord's Blog

LINQ views the Image type in SQL Server as Binary. So, there are a few options that we have. We can either (a) modify our LINQ to SQL class and change the property to Byte() instead of Binary or we can (b) convert the Binary to an array. To do the latter...

SQL Management Studio Shows All Databases by Jason N. Gaylord's Blog

This has "bugged" me for awhile. When you log into any version of SQL (2000, 2005, and even 2008) as a user with restricted access to just a single database (or even a few databases), you can still see a complete list of all the databases on...
Filed under:

Using "Like" in LINQ to SQL by Jason N. Gaylord's Blog

I've recently discovered that LINQ and VB can be confusing. I was attempting to pull the top 10 rows of a table where the column started with 'W'. You'd think after I typed that, I'd figure out the solution. That's not the case...
Filed under: ,

Using LINQ to SQL and ConnectionStrings in a Class Library by Jason N. Gaylord's Blog

I was looking to separate my LINQ to SQL data layer from the rest of my application. So, I decided to move the files to a class library. This way, when my application builds, all of my LINQ files are found in MyApp.DL or something similar. However, I...
Filed under: , , ,

Obtain the Identity of a New Row Using LINQ by Jason N. Gaylord's Blog

It's actually pretty easy and user friendly to obtain the value of the identity column using LINQ. After you create your object and insert it on submit, you can call the identity column's property on your object. For instance: Dim db As New BlogDataContext...
Filed under: , , ,

Bad SQL Mistake For One Forum Goer by Jason N. Gaylord's Blog

This isn't funny, but it is. It should be a daily WTF. Wally just sent me this forum post where someone deleted a little more than anticipated. It sounds like this guy can be in quite a lot of trouble... http://forums.microsoft.com/MSDN/ShowPost.aspx...

Aggregate Functions in LINQ by Jason N. Gaylord's Blog

I found a great post which summarizes aggregate functions in LINQ. It includes examples for Average, Sum, and Count. Check it out at http://www.dev102.com/2008/04/16/how-to-use-aggregate-functions-with-linq-to-sql/ . As always, you can test your functions...

Generate a PDF behind the scenes using SQL Reporting Services by Jason N. Gaylord's Blog

I came across this really cool demonstration and article by Simon Pang earlier today. I asked around awhile ago for a solution where I could create a PDF on the fly using SQL Reporting Services. Cool enough, he came up with a solution. Check out his article...
Filed under: ,
Powered by Community Server (Commercial Edition), by Telligent Systems