Friday, September 10, 2010
DataView, DataTable, Unique, Select And Filters
Thursday, July 15, 2010
How To Get DateTime In XSLT
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:my="urn:sample" extension-element-prefixes="msxml">
<msxsl:script language="JScript" implements-prefix="my">
function today()
{
return new Date();
}
</msxsl:script>
<xsl:template match="/">
Today = <xsl:value-of select="my:today()"/>
</xsl:template>
</xsl:stylesheet>
/// Takes a string containing XML to be parsed and a string containing the the XSLT to do the parsing.
/// </summary>
public static string XSLTransformation(string xml, string xsl)
{
// create the readers for the xml and xsl
XmlReader reader = XmlReader.Create(new StringReader(xsl));
XmlReader input = XmlReader.Create(new StringReader(xml));
// create the xsl transformer
XslCompiledTransform t = new XslCompiledTransform(true);
XsltSettings settings = new XsltSettings(false, true);
t.Load(reader, settings, null);
// create the writer which will output the transformed xml
StringBuilder sb = new StringBuilder();
XmlWriterSettings tt = new XmlWriterSettings();
//tt.Encoding = new UTF8Encoding(false);
XmlWriter results = XmlWriter.Create(new StringWriter(sb)); //, tt);
// write the transformed xml out to a stringbuilder
t.Transform(input, null, results);
// return the transformed xml
return sb.ToString();
}
Tuesday, March 09, 2010
Drive Space Disappearing Captain!
- C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
- Take DB offline
- Detach DB (Untick "Keep Full Text Catalogs", if that is the problem part)
- Delete the overly large file
- Re-attach DB, removing the LDF file from the "database details" gridview
- Click "No" to skip re-attaching the log files/full text catalog (you've deleted it)
- Open the DB's "Properties -> Files" dialog
- Under "Autogrowth" click "..."
- Untick "Enable Autogrowth"
- Click Ok
Sunday, November 01, 2009
XSLT, XPath Knowledge Base
Sunday, September 06, 2009
Loving Up The iPhone
- Get an audio file and edit to around 20-30 seconds
- Save as MPEG-4 (.m4a - see WavePad for easy converting)
- Change file extension to .m4r
- Drop into the Ringtones section of iTunes
- Sync Ringtones to your iPhone
Tuesday, June 30, 2009
Creating A Shortcut To Open Current File In Explorer From Visual Studio
Friday, April 10, 2009
P2P What I/You Need To Know
- http://lifehacker.com/software/ultranewb/a-beginners-guide-to-bittorrent-285489.php
- http://lifehacker.com/software/hack-attack/intermediate-guide-to-bittorrent-286607.php
- http://lifehacker.com/372633/protect-your-privacy-when-downloading
- http://phoenixlabs.org/pg2/ - Blocks your computer from connecting to IP addresses which are suspect (ie: which collect information you might want kept private)
- http://btguard.com/ - Paid-for service which provides a proxy through which your connections can be passed, making your IP address sort-of invisible to those you connect to
- http://lifehacker.com/5213712/half+open-patcher-speeds-up-bittorrent-downloads - A patch to Windows allows more than the standard 10 connection attempts, but BE CAREFUL
- http://lifehacker.com/5214801/move-half+finished-bittorrent-downloads-to-another-drive - Move files to another drive and let uTorrent complete them later, saving your initial drive space, etc.
- http://lifehacker.com/350405/top-10-bittorrent-tools-and-tricks - How to get the most out of torrenting and things you probably didn't know you could do
- http://gizmodo.com/tag/p2p/
- http://gizmodo.com/tag/how-to/
- http://gizmodo.com/tag/security/
- http://gizmodo.com/tag/piracy/
- http://lifehacker.com/tag/p2p/
- http://lifehacker.com/tag/security/
- http://i.gizmodo.com/5016514/google-tools-will-tell-you-if-your-isp-is-slowing-down-your-connection
- http://www.techthrob.com/2009/03/02/btguard-anonymizing-service-is-it-worth-it/
Sunday, March 15, 2009
Microsoft links I have yet to read, but really should...
Using Conditions?
How Do I: Create a Breakpoint Using Hit Count?
How Do I; Learn Tips and Tricks for Debugging in Visual Studio?
Office Development with Visual Studio Developer
Center Just Launched!
Microsoft Cloud Computing Tools
How Do I: Add Tool Windows to the Visual Studio IDE?
How Do I: Add a New Tool Window to Visual Studio?
How Do I: Integrate With the Error List?
How Do I: Create a Basic Language Service Using the Managed Babel System?
How Do I: Create Custom
Project Templates Using Visual Studio 2008?
How Do I: Create an Item Template Using Visual Studio 2008?
How Do I: Write to the Output Window?
Explore the New Features of Visual Studio 2008
How Do I: Create a Debugger Visualizer?
How Do I: Place My Commands Into Different Kinds of Visual Studio Menus?
How Do I: Add Commands
and Controls Into the Visual Studio IDE?
How Do I: Get Started with the VisualStudio Domain Specific Languages?
Heroes Happen Here
DotNetNuke® and Visual Studio 2008
Visual Studio Tip of the Day
How Do I: Add AJAX Functionality to an Existing ASP.NET Page?
How Do I: Debug a Windows Presentation Foundation Application in Visual Studio 2008?
How Do I: Use the LINQ-Enabled
XML API in Visual Studio 2008?
Friday, June 20, 2008
Getting ASP.NET Authentication in SQL Working
Firstly, you could go here, which helped me: http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx
Otherwise, just go to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Run the aspnet_regsql.exe and following through the Next button.
If you want to setup a connection to your local machine running sql express, be sure to enter <machinename>\<sqlserver> for example: MATTSMACHINE\SQLEXPRESS
Everything should now be setup.
The next bit is optional, but I like to go to: http://msdn.microsoft.com/en-us/library/cc467894.aspx
Get the latest build of the Microsoft Enterprise Library. The setup is fairly simple, just install and follow the instructions for setting up the web.config and connection strings for allowing the data access layer. This will provide easy to use connection pooling and everything you need for single command SQL execution on your db.
The important entries in your web.config file should be:
<configSections>
<section name="dataConfiguration"...
...
</configSections>
<connectionStrings>
<add name="chopDatabaseConnection" providerName="System.Data.SqlClient"...
...
<dataConfiguration defaultDatabase="chopDatabaseConnection"/>
And you're away!
You might also want to read this: