Hi Rajesh,
This is one of the reasons for which I think and that that SAP does the job at half regarding (at least) the SDK.
The way to connect on a company has changed after the version for which the sample were written, and the samples have never been adjusted
To connect onto a company, you are not supposed to give the db username and password, but the address of the licence server.
Just look at http://scn.sap.com/community/business-one-sdk/blog/2014/09/04/various-sdk-tests, you'll find working examples for 9.x. Not the easieast to start with i fully agree, but at least everything is working and you'll see the "correct" way to connect onto a company.
Regards,
Eric