Browse by Tags
All Tags »
LINQ (
RSS)
When it comes to SharePoint deployments, I try to automate everything I can. I don’t like manual steps especially when it comes to setting up security. A common task when deploying any sites is setting up security in some manner. Today...
This is another topic that is quite dear to most SharePoint developers. We’ve all been there. We want to know if a list item exists and the indexer is useless. It throws an exception should we attempt to access an item that does not...
A few months ago, I discussed how to use LINQ to XML to parse your elements.xml file to delete any files that you may have deployed on feature activation. Today I have decided to reuse this concept to delete any lists that I have created when I...
Today, I had the opportunity to give a short introduction on how to do some basic queries on XML documents with LINQ to XML. In the talk, I talked about how to create anonymous types from your XML document so that you can work with strong types. I also...
I have posted in the past about how to use the KeywordQuery class to execute an Enterprise Search query. This makes it easy to get a DataTable containing search results. However, one caveat with this is that some columns get returned as a string array...
Today, this blog reaches an important milestone. This is my 500th post. It's just a number, but I thought I would use it as an opportunity to talk about the history of the blog and where it is heading. On December 1st, 2004, I wrote my first .NET...
I can't talk about SharePoint all the time, so I thought I would talk about how to perform a type of query with LINQ. In T-SQL you might have wrote something like this at one point. SELECT Title, Id FROM Table1 WHERE Id IN (SELECT Id FROM Table2)...
After you query something with LINQ, you may want to know if any results were returned before your start enumerating or working with the EnumerableRowCollection (that's most likely the type behind that var you are using in most cases). Consider the...
As you know, LINQ is similar in a lot of ways to T-SQL, but as you go to start doing things with grouping or joining, you will find that that there are some syntactical differences. There are two ways you can use the group clause in LINQ, which way you...
In my previous post about using the KeywordQuery class, I had one small omission. The fact is that when you add your own managed properties using the SelectProperties collection of the keyword class, the data type you get back is a string[] containing...
LINQ to SQL has already proved to be extremely easy to use to create object relational mappings when you have an existing database schema using the Object Relational Designer. This designer is good, but you may not want something that is autogenerating...
The other day I was reading Charlie Calvert's excellent post on LINQ and Deferred Execution and stumbled upon a logging feature inside LINQ to SQL. By setting the Log property to a TextWriter (in this case Console.Out), LINQ to SQL will log the query...
Unfortunately, most of us aren't working in a perfect world, so it is bound to happen that you run into a dataset or two. Whatever the reason (the developer was lazy, you're maintaining legacy code, someone didn't know any better, or you're...
I have been doing a lot of document library work lately and in my work I had a need to create a series of subfolders in the document library using a particular custom content type. This meant I was going to need to write a little code. I decided to keep...