Monthly Archives: October 2014

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Stimulsoft

When you run your query, it might run just find but in your stimulsoft report you might get this error. The error could arise from mismatch of parameter or parameter not giving in the URL or too many parameters given. In my case the error was really dump. I was referencing a report that did not exists. That is my report was refering to report1new.mrt which did not exist. I should have been referring to report1.mrt instead. After fixing this error went away.

Hope it helps someone else! A simple spelling mistake!

Court legal term sine die

I heard this phrase from lawyers “Synadize” and I would not find the exact meaning of it. Finally find out the world is actually “Sine Die” which locals pronounce as “synadize”.

Sine Die means adjourning the a case without a return data. This can happen in Pakistan where both parties loose interest in the case and stop attending it altogather (just because it can be a long and lenghty process).They call is Syndiaze but it is actually Sine Die.

Some more legal definitions

How to compare Current File with old Version in GIT (Visual Studio 2013)

git tfs compare

git tfs compare

You can compare a file with its previous version quite easily using git. You can do that either in Visual Studio 2013 (if you have Git Source Provider Extension installed) or even better you can use SourceTree ( a free software) which provided additional benefit of merging the two version if need (using reverse hunk).

SourceTree Diff Tutorial

Select all files from the dropdown box in source tree, look for the file you are interested in.  Right click on the file, select “Log selected”. This will give you history of the file. Highlight any two revision in this window, you will get the difference (diff) of the two revisions. You can select current version vs any old version or two old versions to compare.

Git Visual Studio 2013 Diff

If you have installed Git Source Provider Plugin, you can right click on the file and select “view History”. Here you can do the same, select any tow revisions and the right click while selecting on of them and select compare.

executenonquery returns -1 on success

ExecuteNonQuery is suppose to return the number of rows inserted, updated or deleted but in my case it always return -1 even though the record is successfully added.

Found out

SET NOCOUNT OFF

was missing my in my stored procedure. If you have multiple SQL statements in your stored procedure, initially set it to on by

SET NOCOUNT ON

which will not count any rows affected. Later to monitor the statement you are actually interested in, set it to OFF.

Hope that resolves your problem!

how to clone in sourcetree on mac

create git clone in sourcetree on mac

create git clone in sourcetree on mac

SourceTree on Mac does not have a clone button in the toolbar (it does in the Windows Version), so how do you clone a git repository on mac? In any open Window go to

Goto File > New / clone

You will see four options. Select the first “Clone from URL”. The above dialog box will appear. In source URL, you will have to copy the source destination (no browse button available). In destination, click the browse button and navigate to where you want to create clone (you might have to create new directory). Give it a name and you should be all set.

This apparently is too complicated than it should be.

Website works in Visual Studio but does not work in IIS

In visual Studio project is run under local user, who usually have full permission to resources such as folders and databases. In IIS, the Application is run under Local System or Network User etc which do not have full permission to all folders and the databases. In fact they don’t have access to databases at all.

To trouble shoot enable error reporting, if you are using exceptions, throw exception back in the catch block so you can see what is going on.

Solution

Create a new service user or just a regular user and make this user admin. In application pool in IIS, select the AppPool that is giving you the problem, click on advance setting and change identity to this new user. That should fix the problem.

It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level

Scott Michell wrote an excellent article about the above error explaining exactly why are you getting this error. Basically you are opening the parent folder of a project in Visual Studio and you get this error. Since web.config in this case is in sub folder, you get this error.

A little Explanation

There can be more than one web.conf files in your application. They can be all in root or in sub folders as in nested form. The root web.conf can contain almost all elements but that that are nested in sub folders may not contain certain elements. This error is about this scenario.

Resolution

Lets say you have project in this folder

d:\project\myfirstapp\main\

If you open myfirstapp in Visual Studio you will get the above error. To resolve reopen the project and select main as your project.

Explanation: The IP address for the website you requested could not be found.

Network Access Message: The website cannot be found
Explanation: The IP address for the website you requested could not be found.

Error Code 11001: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access. This is usually due to a DNS-related error.
Date: 10/9/2014 5:36:12 AM [GMT]
Server: nserver
Source: DNS error

This IIS related error could arise if you are trying to access a local site and you are using proxy. The proxy server directs all request to the Server it is configured again. To resolve this error you have to add exception for local address. In FireFox, go to Options > Advance > Network TAB > Connection Setting. In the bottom add the address you don’t want to use proxy for. If the error is proxy related, it should go away.

Another tip: If you are using a domain address (e.g. local.mytestsite), make sure you add entry to local host.