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

June 2009 Entries

Extension Method to Resize an Image

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.Linq; 4: using System.Text; 5: using System.Drawing; 6: using System.Drawing.Drawing2D; 7: ...

posted @ Sunday, June 28, 2009 6:52 PM | Feedback (3) | Filed Under [ C# Images ]

Perspectives on Technology from Tech Ed North America – Shawn Weisfeld and Allen White

Check out this recording I did for the folks at the MVP Program at TechEd 2009 http://blogs.msdn.com/mvpawardprogram/archive/2009/06/19/perspectives-on-technology-from-tech-ed-north-america-shawn-weisfeld-and-allen-white.aspx MVP Shawn Weisfeld_Visual C#_MV_Andy Malone_Setup & Deployment MVP Shawn Weisfeld_Visual C#_MVP_Allen White_SQL Server

posted @ Wednesday, June 24, 2009 2:08 AM | Feedback (0) | Filed Under [ MVP ]

Get an Email from TFS on Check-in

Want to get emails every time anything is checked into TFS? Open VS.NET, find the “Team” Menu and the “Project Alerts . . .” Option. Once there you can select what you want alerts by and enter your email address. Now hold on and watch your inbox fill up with all kinds of great information.

posted @ Wednesday, June 24, 2009 12:42 AM | Feedback (0) | Filed Under [ TFS ]

Silverlight & no 64 bit

When attempting to use a Silverlight application in the 64-bit version of IE you will get this message. “Microsoft Silverlight cannot be used in browsers running in 64 bit mode.” At first I was disappointed because I would like to see more of the industry move to 64 bit. Heck they are selling it at Best Buy now. However does Silverlight really need 64 bit? 64 bit gives you more throughput on the processor and more access to memory. But it is defiantly not typical for Silverlight applications to need that much memory and/or do highly processor...

posted @ Thursday, June 18, 2009 10:18 AM | Feedback (0) | Filed Under [ Silverlight ]

Query SharePoint with .NET

I was attending the SharePoint Developers Group Meeting (http://www.dspdg.org) last week and the presenter, Ty Anderson, of http://www.cogentcompany.com & http://www.officedeveloper.com demoed using MS Access as a shim to bridge the communication between a VSTO application and a SharePoint List. I thought the idea was cool so I threw together this quick sample for your consideration. Note: I have not tested this in a multi-user environment, nor would I recommend this when performance is a high priority. Regardless it is very cool! Step 1: Create your list in SharePoint: Here you can see my TestList, it has one column called...

posted @ Thursday, June 18, 2009 9:52 AM | Feedback (0) | Filed Under [ SharePoint ]

Property Causing a Stack Dump

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

posted @ Tuesday, June 16, 2009 12:26 AM | Feedback (0) | Filed Under [ .NET C# ]

Populating a Generic List in VB.NET

Got a question on how to populate a generic list in VB.NET, and while I am a C# guy, I figured I would show some VB.NET love. For this example I will be using a customer class, he is real simple just 2 properties. One for first name and one for last name. 1: Public Class Customer 2:   3: Private _first_name As String 4: ...

posted @ Tuesday, June 16, 2009 12:17 AM | Feedback (2) | Filed Under [ .NET VB.NET ]

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

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

posted @ Thursday, June 11, 2009 5:12 AM | Feedback (0) | Filed Under [ SQL ]

SQL Server: Who am I?

Got a question today. How do I tell what user my sql server query is running as? Well you just ask. Using the USER_NAME() function, without passing it an id, finds the name of the current user. http://msdn.microsoft.com/en-us/library/ms188014.aspx Using the SUSER_NAME() function, gets me the login identification name of the user. http://msdn.microsoft.com/en-us/library/ms187934.aspx   Here is an example of each, using both a regular sql server login (left) and windows authentication (right)   Now that I know who I am, why not be someone else. . . In this...

posted @ Thursday, June 11, 2009 3:48 AM | Feedback (0) | Filed Under [ SQL ]

SQL Server 2008 Access is Denied Error During Install

Problem: when installing SQL Server 2008 you get an Access is Denied Error. Here is the error you get during install. . . . Fix: Check your Local Security Policy, you need to ensure that Administrators have “Debug programs” permission (Security Settings | Local Policies | User Rights Assignment) More information can be found in the following articles: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=390424 (If you have had this error please follow this link and vote that it gets fixed in connect) http://social.msdn.microsoft.com/forums/en-US/sqlsetupandupgrade/thread/ed4514fa-8d1d-4383-bbdf-fb06bfbad106/ http://support.microsoft.com/?kbid=2000257

posted @ Monday, June 8, 2009 10:33 AM | Feedback (2) | Filed Under [ SQL ]

Powered by: