Hi Arpit,
I recommend you always set the license server location, including the port number in your code.
Common causes of that error are:
1) The correct version of SQL Native Client is not installed on the local machine. In your case you will need the SQL Native Client 2008 R2.
2) The Company.Server value needs to exactly match the name you've used in the SLD. If you open the SAP Business One client and go to Change Company then the server name will be shown. If you've used the IP Address on the server, rather than the server name then you must use this in your connection code.
3) Is there a Windows firewall blocking the SQL port (1433 by default) or the SAP License service (ports 30000-30010) between the server and the machine running your code?
3) SQL user and password is incorrect. I'm sure you've tested this already but try creating a system DSN in Administrative Tools, using the SQL Native Client driver to make sure there is nothing wrong with the SQL settings.
Kind Regards,
Owen