Sunday, February 3, 2008

Customize or tweak your Vista

Here is an overview what i did when you install Vista.

STEP 1 : Create partition --> Use BootIt to create my partition and choose type NTFS (walkthrough for using BootIt)
STEP 2 : Boot from Disk --> Easy, just put the DVD in boot drive and restart computer
STEP 3 : Disable UAC --> (you can do this in 4 ways) See this post on how to disable UAC.
STEP 4 : Disable the Warning Icon (now that UAC is turned off)
  1. Right-click the Security Center icon in the notification tray, select Open Security Center.


  2. In the Security Center window, click on the "Change the way Security Center alerts me"


  3. In the "Do you want to be notified of security issues" window click on "Don't notify me and don't display the icon (not recommended)".

STEP 5 : Install Anti-virus --> for example Avast it's free :-)
STEP 6 (optional) : Startup without logging in.
When using the PC @ home, and it is difficult to login each time. You can open Start and enter in the Searchbox "netplwiz".
You will see a window useraccounts. Select the box and it will be turned off. (confirm by entering 2 times your password to be sure)

Tip: If you have a program that stops working in vista, you can run that program in XP mode.

Tuesday, January 29, 2008

Cleaning up transaction log from database

I had a problem with cleaning up logfiles from some database.
But when the script does not work you have to search an other way.

I found a solution to clean up the logfiles, it's not a neat one but it works.

Follow these 3 steps:
  • Detach the database
  • rename the LDF
  • Attach again.
    It will alert you to the fact that there's no log file, and will create a fresh one for you.
    (The log file has shrunk from 1Gb to 700k)

Thursday, November 22, 2007

Always show solution in Visual Studio

I installed Visual Studio Team System on my laptop. When i have created a new Solution you see this in your Solution Explorer. On your Solution you can now add projects. What i did is click right on the solution in the solution explorer and select "add new Project". After the creation of the project you only see the project in the solution explorer. To add a second project you can go to File -> new project. In that form you have to select "add to solution" and your "location of the project". (After that the solution is visible again.)
But you can set view "Always show solution" on like this:
  • Select tools in menu
  • options
  • collapse tree structure and go to "Projects and Solutions"
  • there you can activate "Always show Solution"

Tuesday, November 6, 2007

I have a daily job to create a backup from a file. But each backup must have a different name.
What i did is create a schedule job on my XP machine with .BAT file that runs every day.

The hard thing in Dos is giving a name that is unique.

Here are the doscommands:

@echo off
for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set yyyymmdd=%%k%%i%%j
echo Date: %yyyymmdd%
for /F "tokens=1-2 delims=: " %%l in ('time /t') do set hhmm=%%l%%m
echo Time: %hhmm%
rem -- or use both
echo %yyyymmdd%%hhmm%
rem -- here is the copy command with just the date appended

REN E:\Sx3\FTP\pl.txt pl%yyyymmdd%%hhmm%.txt
REN E:\Sx3\FTP\llpg.txt llpg%yyyymmdd%%hhmm%.txt


overview parameters you find here

Thursday, April 5, 2007

Dev Days 2007 materials and more ...

Here you go ...

Other event materials:

Enjoy :-)

Wednesday, April 4, 2007

Fix to copy large files in vista faster

Yes, the title is correct ! Vista has problems with copy large files.

This happens especially with mapped drives but it could also be that you witness network disconnects.

The problem is caused by a new feature called Auto Tuning which is by default enabled in Microsoft Windows Vista. What Auto Tuning does is that it reacts on changes in the network by tuning the receive windows size. The solution would be of course to disable Auto Tuning in Vista. Some users reported that disabling Auto Tuning had a positive effect.

Here are workarounds from Support Microsoft website to of from earlier OS.

To disable Auto Tuning and speed up the copy process and avoid timeouts and disconnects do the following:

Open a command prompt and type the following:

netsh int tcp set global autotuninglevel=disabled

To turn it on again:

netsh int tcp set global autotuninglevel=normal

Tuesday, March 13, 2007

GetOrdinal example


When you use the ExecuteReader,
you have to select the fields created from the select statement.

There you have to be carefull with the numbers you give in the reader.

Here is the example using a MySQL database:

String select = "Select id, first_name, last_name, nickname from table_name"
MySqlCommand command
= new MySqlCommand();
MySqlDataReader reader;
MakeConnection();
command.Connection
= connect;
command.CommandText
= select;
reader
= command.ExecuteReader();
while (reader.Read())
{
//-> Fist column selected
int id = reader.GetInt32(0);
//->Second Column Selected
string FirstName = reader.GetString(1) ;
//->3é Column Selected
string LastName = reader.GetString(2) ;
//->Last Column Selected
string NickName = reader.GetString(3) ;
}
MakeDisconnection();


But when you change the select statement you have to pay attention that the order is exact the same order for the reader.

By Using the GetOrdinal is the possiton not a problem anymore.

This example show's the use of GetOrdinal:
(Only the select statement is changed by order.)


 

String select = "Select nickname, last_name, first_name, id from table_name"
MySqlCommand command
= new MySqlCommand();
MySqlDataReader reader;
MakeConnection();
command.Connection
= connect;
command.CommandText
= select;
reader
= command.ExecuteReader();
while (reader.Read())
{
//-> Fist column selected
int id = rdr.GetInt32(rdr.GetOrdinal("id"));
//->Second Column Selected
string FirstName = reader.GetString(rdr.GetOrdinal("first_name")) ;
//->3é Column Selected
string LastName = reader.GetString(rdr.GetOrdinal("last_name")) ;
//->Last Column Selected
string NickName = reader.GetString(rdr.GetOrdinal("nickname")) ;
}
MakeDisconnection();

This works and you don't have any troubles with the order.

Saturday, March 10, 2007

Validate value on DBNull


You need a specific value from a datareader, and it is possible that the value is DBNull.

This way we validate the value on DBNull.

if (!reader.GetValue(6).Equals(System.DBNull.Value))
{
tempr.aantalPlaten
= reader.GetInt32(6);
}