Browsing articles in "Development Tools"

Installing Windows 8 Developer Preview

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

So I think that everyone heard that a New Windows is coming to town. This week, on Tuesday, which was also the Programmer’s Day, Microsoft showed the New Windows 8 OS during it’s BUILD Conference. And it was really a great present for all Programmers!! At least I’m really excited to try the new OS and start using the new Developer Tools. You can find more info on Windows 8 in the next links:

http://www.winsupersite.com/article/windows8/windows-8-developer-preview-140546

http://www.engadget.com/2011/09/13/windows-8-details-new-features-ui-enhancements-and-everything/

Installing

I’m upgrading my Windows 7 laptop to Windows 8, so it’s not a clean install. Up till now it’s 77% and it took about 25 mins. A clean install would definitely take less time.

The laptop is a bit old, in fact it was a Windows XP laptop. It’s a VAIO powered by 1.6GHz Single Core Centrino CPU and 1GB of RAM. With Windows 7 it was running fine for normal day to day use. We’ll see how it fares with Windows 8! I’ll keep you posted. Anyone installed the Windows 8 Developer Preview? What do you think?

UPDATE 1: And it’s ready installing. For an upgrade on a 1.6GHz Centrino laptop, with 10% of free hard disk space, it took around 40 mins.

UPDATE 2: Getting devices ready and now Applying User Settings from the Windows 7 installation!

Continue reading »

Find Database Creation Date | Quickie

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!
Database
To find the database creation dates, you need to insert the following query in SQL Server
USE master
SELECT name, crdate
FROM dbo.sysdatabases

Order BY Not Working in SQL Server Functions | Quickie

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Database

Ever created a function and needed to include the Order By clause. It would result in the following error being loaded:

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.

The problem is that to use, it requires a TOP clause or FOR XML. By if you specify TOP 100, you’ll only get the first 100 rows. You can specify a big number that you might think will never exceed. But what if you do? The best bet is to use TOP 100 PERCENT.

This will get you all the rows and works in Functions.

For Loop with Negative Step | Quickie

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Cannot believe that I’m writing some helpful examples using VB.Net, but that is the language that we’re using at work, so have to adapt now. Next find how to make a loop with a negative step (decreasing step):

Imports System

Public Class MainClass
 Shared Sub Main()
 For intCount As Integer = 10 To 1 Step -1
 'Add the item to the list
 System.Console.WriteLine(intCount)
 Next
 End Sub
End Class

Solution | Unable to write output file ‘…pdb’; unspecified error

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Visual Studio 2005 / 2008

During this weekend, I started having a problem when building a solution in Visual Studio. It would load the following error:

Unable to write to output file Solution_Name.pdb

This Visual Studio solution has 8 projects, and a lot of files and folders. I tried several solutions that I found on the net, which worked for others, but none worked for my case including:

  • Delete the .pdb file from the solution – Didn’t Work
  • Delete the Debug folder – Still Didn’t work
  • Delete the whole obj Folder – Nothing Continue reading »

ASP.Net | Read Values from Javascript

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

Today I started checking out some videos about Windows CardSpace and ASP.Net for logging in and I saw how he used javascript to get client side input and use it in ASP.Net in the C# code.

First you need to create a HiddenField on your webForm and name it TokenField (any name would actually do)

<asp:HiddenField ID=”TokenField” runat=”server” />

To set the Hidden Field value in JavaScript use the following code: Continue reading »

SQL Server 2005 | Add days, months and years to GetDate()

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

To get the current date in Sql Server queries and stored procedures, you use the GetDate() method. But what about to add a day or two to the current date, or add a month or years? To do it, you use the following query:

Add One Day

SELECT DateAdd(dd, 1, GetDate())

Add One Month Continue reading »

SQL Server | Convert Varchar to UniqueIdentifier

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

There are 2 ways to Convert a string to a UniqueIdentifier (GUID) in SQL Server:

SELECT CAST(’449141d9-86c9-449d-be2c-1f171b4f4567′ as UNIQUEIDENTIFIER)

SELECT CONVERT(UNIQUEIDENTIFIER, ’449141d9-86c9-449d-be2c-1f171b4f4567′)

Upload JSP Sites on MochaHost | Hosting

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

This weekend we’ve been trying to choose a hosting for our JSP site which we’ve been developing. We’ve had a hard time searching for the right hosting provider, a host which allows JSP sites, is reliable and cheap. After a lot of searching, we chose to try MochaHost. We found a lot of bad reviews all over the net, but despite we wanted to try them out, mostly because it is the cheapest hosting we found.

We’ve set up the servers and uploaded the sight, though we had a problem uploading it. There are some things you need to do before uploading a JSP site from NetBeans to MochaHost. Next are the steps… Continue reading »

SQL Server | Remove Special Characters

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!

I needed to remove all the special characters from a field in a particular table in SQL Server to be used for searching purposes. After searching (binging :P )… I found the next SQL Server Function which did the trick.

This Function Removes any special character from the string value passed. All characters except 0-9, a-z and A-Z are all removed, whilst the remaining characters are returned back.

ALTER FUNCTION dbo.RemoveSpecialCharacters
(
@s VARCHAR(256)
)
RETURNS VARCHAR(256) WITH SCHEMABINDING

BEGIN
IF (@s is null)
RETURN null Continue reading »

Pages:12345»