Browsing articles in "Quickie"

File Sharing between PCs without Password Protection

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

Sometimes you would need to share a file or a folder with another user and you would find it not so easy to do so, more and more if you or the other user doesn’t have a password for your account.

By default, in Windows 7, in order to share a folder, you would need that the Source PC being shared has a password and the Source PC owner would need to give you his password. There are two options to overcome this situation. Continue reading »

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.

Add AutoNumber to GridView showing the RowNumber | Quickie

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!
The code below will add a column showing an incremental number near each row, which ultimately is the row number
<asp:TemplateField>
  <ItemTemplate>
    <%# Container.DataItemIndex + 1 %>
  </ItemTemplate>
</asp:TemplateField>
Hope this helped ;)

Quickie – New Line in an Excel Cell

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

Just found this quick tip on how to enter a new line in an Excel cell. The trick is to use the key combination of Alt+Enter to create a new line. And when you do it, Excel will automatically enable text wrap for that cell.

For Windows use

Alt+Enter

For the Mac Users it is a little more tricky

Hold down Apple Key + Option + Enter 

C# | Call Overloaded Methods

Fatal Error: get('adsPerSlot') in Admin Options don't exist (not an array)!
Sometimes in C#, to call overloaded methods within the same method names, we still use the old method. In C# there is a neater way to pass arguments to overloaded methods which can be seen below:

Div OnClick instead of a href | Quickie

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

Instead of using the “<a href=” tag to go to another page, you can use the “<div onclick=” to be transferred to another page. This is extremely useful if you have a lot of text and pictures that need to be clicked anywhere wanted. Next is the html code to achieve this:

<div id="div_id" onclick="window.location = 'Your reference here'>
Your text here
</div>

Hope this Quickie was of help ;)