Thursday, July 29, 2010

Change UPPER CASE to Title Case / Proper Case - supports all punctuation

create function ProperCase(@Text as varchar(8000))
returns varchar(8000)
as
begin
declare @Reset bit;
declare @Ret varchar(8000);
declare @i int;
declare @c char(1);

select @Reset = 1, @i=1, @Ret = '';

while (@i <= len(@Text))
select @c= substring(@Text,@i,1),
@Ret = @Ret + case when @Reset=1 then UPPER(@c) else LOWER(@c) end,
@Reset = case when @c like '[a-zA-Z]' then 0 else 1 end,
@i = @i +1
return @Ret
end




select dbo.ProperCase('this,my friends, is a test.wHat DO you think?i like shaquile o''neal')

Sunday, March 29, 2009

Post from email Really?

This is apparently how you post from email…

How to convert Access DB to SQL 2005 DB

You need to use: SQL Server Migration Assistant for Access (SSMA for Access)

http://www.microsoft.com/sqlserver/2005/en/us/migration-access.aspx

Wednesday, March 11, 2009

Asp.net development server stopped working

Asp.net development server stopped working
just like on 10/03/09 ? Yeah thank MicroSoft for that they released an update on Windows Defender that defends you from working.

Stupid thing changes hosts file to some apparently IPv6 shite but messes up ur developmet server

Here is what to do:

1. Locate the hosts file with notepad "C:\Windows\System32\drivers\etc\hosts"
2. Find line that says "::1 localhost"
3. Replace it with "127.0.0.1 localhost"
4. Save
5. Windows defender is gonna notify you that you might got hijacked!
6. Tell it to go fuck itself

Job Done - you can work again!

Sunday, March 08, 2009

How to change CurrentCulture CultureInfo in vb.net

Had a problem with ASP.NET site with the LIVE webhosting site beeing in the US and it was not formating my dates the way I wanted them by default.

Add this code to change CurrentCulture to whatever you want:


Dim ci As New System.Globalization.CultureInfo("EN-GB")
System.Threading.Thread.CurrentThread.CurrentCulture = ci
System.Threading.Thread.CurrentThread.CurrentUICulture = ci

Tuesday, February 10, 2009

Terminal Services License Crack

ON SERVER:

Go to %WINDIR%\system32\lserverNotice the file TSLIC.edb. Rename it to tslic.old

ON CLIENT:

In every client computer, remove the CAL TS registry keys, located
at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing

Restart your server.


ALTERNATIVELY:

On SERVER

1. UnInstall the Terminal Server Licensing
2. Install the Terminal Server Licensing again
3. Restart server

On CLIENT

1. Delete the whole key called : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing

Wednesday, February 04, 2009

Sony Ericsson P1i won't play video from m.youtube.com

PROBLEM:
When you are connected using WIFI to your own network and you can browse the web ok with the P1i but you go to http://m.youtube.com/ (mobile youtube that has videos in 3gp format for mobile devices) and you click Watch Video - the phone would buffer it to 100% but then say could not connect to the specified location.

RESOLUTION:

Problem is with your router blocking the ports that are needed by the P1i to stream the video.

1. Assign a static IP to the phone (example 192.168.1.192) (this is for security so that you don't open the ports to all devices on your network)
2. On your router under Open ports setup to that IP (192.168.1.192)












3. Setup the port redirection table as per the picture below


Sony Ericsson P1i won't connect to 802.11g network 54g - Could not locate remote server

Had a problem with my Sony P1i - it would connect to a 802.11b networks ok but when it was connected to a 802.11g network it would connect ok but on browsing th web the message:

Could not locate remote server

Would always come up.

RESOLUTION:
Updating the phone's software using the Sony Software that came with the phone fixes this issue

Sunday, December 21, 2008

How to change password for sa login in management studio

How to change password for sa login in management studio

1. Security/Logins/sa - right click Properties / General TAB

more info:


http://blog.sqlauthority.com/2007/12/29/sql-server-change-password-of-sa-login-using-management-studio/