True is not true (?)

Written by Ingmar Verheij on October 21st, 2010. Posted in VB.Net

The string 'True' is not a valid Boolean value.
This error is thrown when an XML file is read into a DataSet using “System.Boolean” as DataType.

Exporting data from SQL to XML

Written by Ingmar Verheij on May 8th, 2010. Posted in Batch

Exporting data from a SQL database to a XML file is very easy, if you know how to.
Using the bcp command (bulk copy program), a tool supplied by Microsoft, you can easily export all the data you want.
– Create a new text file and type the following text:

<root>
</root>

– Save the text file with a .xml extension, for instance data.xml;
– Open a new Command Prompt (as Administrator in Vista/Win7/2008 R2);
– Execute the following command : bcp.exe “SELECT * FROM Table AS XML RAW” queryout data.xml -c -r -t -T.
If you want to script the process with batch (we’re a big fan of batch files) you can use the following script:

@Echo Off

REM Create an empty XML file
ECHO ^<root^> >data.xml
ECHO ^</root^> >>data.xml
REM Export the data using BCP
bcp.exe "SELECT * FROM Table AS XML RAW" queryout data.xml -c -r -t -T.

Ingmar Verheij & Daniel Nikolic

Empty variables during FOR loops in batch files

Written by Ingmar Verheij on April 27th, 2010. Posted in Batch

Batch files (*.bat / *.cmd) are easy to build and yet powerful scripts .
Although time is catching up and batch files are more and more replaced by vbScript and PowerShell, there are occasions you need them.
Batch files are especially powerful when you’re using (for) loops and variables. But the combination of those two is somewhat of a problem. Why? It doesn’t (seem to) work…
Let’s take the following situation.
You want to build a script that searches for files with a given extension in a given directory. You then strip the extension of the filename and process the file. This script would look like this:

RE: Installing Windows Features with Windows PowerShell

Written by Ingmar Verheij on February 17th, 2010. Posted in Deployment, PowerShell

Recently my colleague Robin Plomp wrote an article about installing features in Window Server 2008 R2 (or Windows 7) with Windows PowerShell scripts:

“I ‘m a big fan of the new version of the Windows server platform. I’ve recently deployed 6 Windows 2008 (64) R2 servers. On one of the servers I am going to install Microsoft Office Communicator 2007 R2. One of the prerequisites is .NET Framework 3.5 SP1. This can be installed in the ServerManager under Features. This means you have to scroll down a long list of Windows Features. There has to be an easier way.
Enter the world of Windows PowerShell!”

Read more

Although PowerShell is a great tool for installing features, or performing other tasks, it isn’t necessary for automated installation of features.
Enter the world op “Deployment Image Servicing and Management(DISM)” or dism.exe (located in the system folder)!!!

Donate