posts - 76, comments - 26, trackbacks - 0

cheatsheet

Backing up with T-SQL

I never remember this syntax, so here it is for future reference: To back with a SQL Server database with T-SQL, this is the command: BACKUP DATABASE [YourDb] TO DISK = N'C:\YourDb.bak' WITH STATS = 1   Be careful with using WITH STATS = 1 on very large databases

posted @ Friday, July 09, 2010 9:03 AM | Feedback (0) | Filed Under [ cheatsheet ]

Using XPath to select nodes with a missing attribute

The only thing worse than my XPath skills are my RegEx skills.  I don’t use XPath all that much these days, but today I needed to.  It took me a while to find a code sample that does this.  After a playing a bit with SnippetCompiler, I found the solution:   StringBuilder builder = new StringBuilder(); builder.AppendLine("<foo>"); builder.AppendLine("<bar baz=\"a\">1</bar>"); builder.AppendLine("<bar>2</bar>"); builder.AppendLine("<bar baz=\"b\">3</bar>"); builder.AppendLine("<bar>4</bar>"); builder.AppendLine("<bar baz=\"c\">5</bar>"); builder.AppendLine("</foo>"); XmlDocument doc = new XmlDocument(); doc.LoadXml(builder.ToString()); XmlNodeList nodes = doc.SelectNodes("//foo/bar[not(@baz)]"); if ( nodes == null ) { WL("nodes was null"); } else { foreach ( XmlNode node in nodes ) { ...

posted @ Thursday, January 14, 2010 8:05 PM | Feedback (0) | Filed Under [ cheatsheet development ]

Windows 7 Paving – New Base Image Software List

It’s here… good bye Vista – won’t be missing you.  Hello beauty I just paved my machine with the new RTM of Windows 7 Ultimate.  Below is my base image – now it’s time to back everything up to my home server. Windows Live Mesh I had to cut Mesh out of my life.... it was hogging too many system resources - especially disk reads.  I...

posted @ Saturday, August 08, 2009 10:23 AM | Feedback (0) | Filed Under [ microsoft personal cheatsheet ]

Important SQL Server Database Properties and JumpstartTV

JumpstartTV is another one of these sites that are popping up that offer short and sweet tech screen casting.  They offer 5-10 minutes videos covering the basics of a narrow technical topic.  JumpstartTV focuses primarily on SQL Server topics, but they do have other material from time to time.  I like this because I’m not really a database guy.  I’ve designed a built a lot of applications, and therefore I fully appreciate the role the RDBMS plays in an system architecture, but my mind thinks in objects – not relational schema. Today’s topic was SQL Server Properties to Avoid...

posted @ Friday, January 23, 2009 10:22 AM | Feedback (0) | Filed Under [ cheatsheet architecture ]

ASP.NET States DropDownList

I've had to build one of these a few times over the years. If you want a very quick and dirty dropdown of US states in an ASP.NET app, here is the code 1: <asp:DropDownList runat="server" ID="StatesList"> 2: <asp:ListItem Value="AL" Text="Alabama"></asp:ListItem> 3: <asp:ListItem Value="AK" Text="Alaska"></asp:ListItem> 4: <asp:ListItem Value="AZ" Text="Arizona"></asp:ListItem> 5: <asp:ListItem Value="AR" Text="Arkansas"></asp:ListItem> 6: <asp:ListItem Value="CA" Text="California"></asp:ListItem> 7: <asp:ListItem Value="CO" Text="Colorado"></asp:ListItem> ...

posted @ Tuesday, September 02, 2008 12:00 AM | Feedback (0) | Filed Under [ .net cheatsheet ]

DOS and VBS Syntax Reminders

From time to time I have to break out skills from my past.  I needed to solve a few problems today that required a VBS script and a couple of batch scripts.  It took me longer than I care to admit to remember how to do this. So, this post is a reminder for my future self. Here's how to set a local variable in DOS and use them, as well as how to use a system environment variable (WinDir): 1: SET INTERNAL_ROOT_PATH=D:\foo\trunk 2:  3: svn.exe update %INTERNAL_ROOT_PATH% 4: %WinDir%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe %INTERNAL_ROOT_PATH%\Internal.sln /Property:Config=Release Here is...

posted @ Friday, August 22, 2008 12:00 AM | Feedback (0) | Filed Under [ cheatsheet development ]

Powered by: