Displaying posts written in

August 2009

Share Printers from Ubuntu host and VirtualBox Windows guest

Ubuntu Host First of all you have to enable printer sharing, so open Printer Configuration from System/Administraton/Printing choose menĂ¹ Server/Settings enable check “Publish shared printers connected to this system” Ok, host is ok, and I hope you have printer installed… Windows VirtualBox Guest By default your network card is configured with a virtual nat router, [...]

How to Get User Name, Domain Name, Computer Name in .NET

.Net has a nice support for these things, examples are in C# but VB Net translation is obvious, let’s see it: User Name The simplest way to retrieve username in .NET is to use System.Environment namespace: string sUserName; sUserName = System.Environment.UserName(); Note that user name retrieved is the user that launch process. Domain Name Again [...]

Unzip multiple files from command line

I suggest to use 7Zip, it’s open source, manage quite all compression standard, and it has a great command line support. From command is: 7z.exe e *.zip 7z.exe is the command, e stands for extrat *.zip stands for “all zip files” If you need to force overwrite all files, add -aoa at end of command. [...]

How To Shrink SQLServer Log File

It’s a very old bad thing of SQLServer, but each time I need this I have to loose an hour to find the correct syntax. Open Microsoft Query Analyzer if you have SQL Server 2000 or Microsoft Management Studio if you are using SQL Server 2005; note that you can manage SQLServer 2000 servers from [...]

Split a DataSet DataTable into more DataTables

for – To split a DataTable into more DataTables you need to process table rows with a loop, you know how many rows you have, so for loop is the choice. Clone – The fastest method to create tables with original columns structure is Clone method. ImportRow – In order to preserve rows states while [...]