At a minimum, your connection string is trying to connect to database inside your VM, not on host machine:
private string connectionstring = @"Data Source =127.0.0.1,1433 ; Network Library=DBMSSOCN ;Initial Catalog=EyeCareCenter ; Trusted_Connection=True ";
The IP should be changed to that of your host machine to connect to it. And make sure that your VM is configured for networking, and that networking configuration allows for connecting to your host machine.