June 2009 Entries
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;
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
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.
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...
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...
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...
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
3: Private _first_name As String
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...
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...
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)