in
tri
home of the trivadians

Nach Ordnungsbegriffen durchsuchen

  • Design Guidelines for LINQ

    Have you wondered if and when you should use the new LINQ features in .Net 3.5? Like, where should I put a new extension method? Should I use Func<T> or a custom delegate? How do I best implement a mix-in (extension methods on an interface)? Well, Mircea Trofin has just published a new draft...
    Erstellt in Richard's blog (Weblog) von Anonymous am 03-13-2008
  • The LinqDataSource and the Hidden Viewstate

    Yesterday I thought I’d learn about the LinqDataSource in ASP.Net 3.5, and got an interesting surprise. The new LinqDataSource can also be used with a LINQ-to-SQL model to perform updates. You simply add the DataSource to your page, set the table name, and set EnableUpdate to true. Then, using...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-21-2008
  • How to Update Data with LINQ-to-SQL

    When learning LINQ-to-SQL, it’s not immediately obvious how to do an update. Querying is easy, and there are methods for inserting and deleting. Updating usually occurs by modifying an object already known to the DataContext and then calling SubmitChanges on the context. var product = (from p in...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-18-2008
  • How to See the SQL Generated by a LINQ to SQL Command

    Quick tip: If you want to see the SQL generated by LINQ to SQL for a query or command, simply set the Log property of your generated DataContext class to an instance of a TextReader. If this is your code: using System; using System.Linq; using System.Data.Linq; namespace LINQtoSQLConsole { class...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-14-2008
  • How to Use Grouping in C# LINQ Syntax

    When you started using LINQ, did you think it looked like SQL? I did. The more I learned LINQ, the more I realized it wasn’t anything like SQL. Take grouping, for example. Because LINQ has a group by statement, and it looks like SQL, I assumed that the syntax for grouping in LINQ would be just...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-08-2008
  • LINQ to DataSets - the Missing Manual

    Last week I had to prepare a small presentation for a new LINQ workshop. For my research, I browsed through the MSDN documentation on LINQ where I came across a reference to “LINQ to DataSets”. I couldn’t find any more information about it though, and so LINQ to DataSets got a small...
    Erstellt in Richard's blog (Weblog) von Anonymous am 02-04-2008
  • Using LinqPad to Create a Time-Selector Drop-Down List

    I am really getting into LINQ now! I think it’s fantastic. I recently wanted to develop a quick drop-down list in ASP.Net which allows a user to select a time of day from a list. The times are 15 minutes apart, so the list would look like this: … 08:00 08:15 08:30 08:45 09:00 … …...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-18-2008
  • Using Lambda Expressions with LINQ to SQL

    When using LINQ, you need to be careful to use the right kind of Lambda expression. “What, there is more than one kind?”, I hear you gasp. There sure is! And if you aren’t careful, you’ll get a nice little message at runtime to tell you: “System.Object DynamicInvoke(System...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-16-2008
  • Inserting into a Table with LINQ to SQL

    While creating a little project, I wanted to know how to insert an object into a table using LINQ to SQL. Using Intellisense it wasn’t obvious at all. Scott Guthrie wrote a post on how do it. Unfortunately, the method name has changed since he did it, so you need to call InsertOnSubmit on the Table...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-15-2008
  • Using LINQ To SQL’s DataContext in a Multi-Tier Application

    I’m still reading the excellent C# 3.0 in a Nutshell, by Ben and Joseph Albahari. It answers a popular question: how do I use a DataContext object in LINQ within a multi-tier application? According to the authors, you cannot use the DataContext at an application or static level, or use a single...
    Erstellt in Richard's blog (Weblog) von Anonymous am 01-02-2008
Seite 1 von 1 (10 Treffer)
/