Shawn Weisfeld

I find when I talk to myself nobody listens. - Shawn Weisfeld
posts - 364, comments - 174, trackbacks - 34

My Links

News


Shawn Weisfeld's Facebook profile

The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.

Archives

Post Categories

LINQ to SQL

Call a Multiple-Rowset stored procedure with LINQ to SQL and without the designer

Multiple-Rowset allows you to return more than one select from your stored procedure. For example in the stored procedure below you can see we have 2 select statements. As we learned in my last 2 posts it is possible to use LINQ to SQL without the designer. A simple select with LINQ to SQL and without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/a-simple-select-with-linq-to-sql-and-without-the-designer.aspx) Call a stored procedure with LINQ to SQL and without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/call-a-stored-procedure-with-linq-to-sql-and-without-the-designer.aspx) To utilize Multiple-Rowset we just need to tweak our function in our data context...

posted @ Sunday, July 12, 2009 4:45 PM | Feedback (0) | Filed Under [ C# LINQ to SQL ]

Call a stored procedure with LINQ to SQL and without the designer

In my last post I talked about how to do a simple select with LINQ to SQL without the designer (http://drowningintechnicaldebt.com/blogs/shawnweisfeld/archive/2009/07/11/a-simple-select-with-linq-to-sql-and-without-the-designer.aspx). This is all well and good, but what if you need to use a stored procedure. Like this one. . . . The first step is to add to our data context a method that maps to our stored procedure. You can see we start off with a Function attribute that tells LINQ to SQL what stored procedure to use. Additionally we decorate the parameters on our method with Parameter attributes that tell LINQ to SQL how to...

posted @ Saturday, July 11, 2009 10:15 PM | Feedback (3) | Filed Under [ C# LINQ to SQL ]

A simple select with LINQ to SQL and without the designer

Many folks poo-poo LINQ to SQL because they don’t like designers. On the other hand some developers, myself included, like knowing how things work behind the scenes, for those edge case moments when the designer cannot do something. The most common business case for this is if you want to LINQ to SQL-afy an existing suite of objects. Well using the designers is NOT a requirement of LINQ to SQL. Lets say for example you had an existing customer table and customer business object: Lets see if we can get LINQ to SQL to...

posted @ Saturday, July 11, 2009 9:57 PM | Feedback (2) | Filed Under [ C# LINQ to SQL ]

Powered by: