CSharpFeeds - All your C# feeds in one place.

Sponsors

Feed: Shawn Weisfeld [MVP]

Site: http://drowningintechnicaldebt.com/blogs/shawnweisfeld/default.aspx Link: http://drowningintechnicaldebt.com/blogs/shawnweisfeld/rss.aspx

Sunday, July 12, 2009

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

by sweisfeld via Shawn Weisfeld [MVP] on 7/12/2009 4:45:23 PM

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 ...

[ read more ]

Saturday, July 11, 2009

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

by sweisfeld via Shawn Weisfeld [MVP] on 7/11/2009 10:15:00 PM

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 wha ...

[ read more ]

A simple select with LINQ to SQL and without the designer

by sweisfeld via Shawn Weisfeld [MVP] on 7/11/2009 9:57:42 PM

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 i ...

[ read more ]

Sunday, June 28, 2009

Extension Method to Resize an Image

by sweisfeld via Shawn Weisfeld [MVP] on 6/28/2009 6:52:00 PM

I wrote this for an INETA project that I have been working on, but thought it would be great to share with everyone. We had a need to take an image and change its size. Below is an implementation of a Resize Extension Method on the .NET Image object.  I borrowed some ideas from this post by Mark McDonnell (http://weblogs.asp.net/markmcdonnell/archive/2008/03/09/resize-image-before-uploading-to-server.aspx) 1: using System; 2: using System.Collections.Generic; 3: using System.L ...

[ read more ]

Tuesday, June 16, 2009

Property Causing a Stack Dump

by sweisfeld via Shawn Weisfeld [MVP] on 6/16/2009 12:26:50 AM

Got a call today, someone was getting a stack dump every time they tried to assign a value to a property. Here is a screen print of the problem they were having. can you spot the problem? If you said that the property is calling itself you get a gold star.  What was happening is that every time we tried to set the Name property, it calls the Name property to set it, and that called the Name property, and that called the Name property, over and over again, till .NET stack dumped. We are m ...

[ read more ]

Thursday, June 11, 2009

SQL CLR: Query the file system to get a list of folders

by sweisfeld via Shawn Weisfeld [MVP] on 6/11/2009 5:12:49 AM

Today was a good day for questions, got one asking how to query the file system from sql server. See they have a list of network shares that they want to find out what folders are in each. SQL CLR to the rescue. . . First lets write a Table Valued Function to get a list of folders. I chose a Table Valued Function so I can join it to a list of paths to search in sql server. Remember that since we are leaving the confines of the SQL Server to get data from the disk we need to elevate our permiss ...

[ read more ]

Thursday, November 13, 2008

WCF & Using Statements

by sweisfeld via Shawn Weisfeld [MVP] on 11/13/2008 11:29:00 AM

I was attending the Dallas Connected Systems UG last night (http://biztalkusergroup.com/) and during the presentation I made the bold assertion that one should NOT use the "using statement" when working with WCF. Now I am a HUGE proponent of the using statement in normal circumstances. IMHO if it implements IDisposable use the using statement, except with WCF. This has to do with the way that WCF errors out and when that happens how the connection gets closed. . . Doing my best LeVar B ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us