0

I have made a web application on windows using VS2017 community. I have created a local db .mdf and the connection string looks like this

<add name="ShoppingWebsiteMVCEntities4" 
     connectionString="metadata=res://ShoppingWebsiteMVC/Models.ShoppingWebsiteModel.csdl|res://ShoppingWebsiteMVC/Models.ShoppingWebsiteModel.ssdl|res://ShoppingWebsiteMVC/Models.ShoppingWebsiteModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\ShoppingWebsiteMVC.mdf;integrated security=True;multipleactiveresultsets=True;connect timeout=30;application name=EntityFramework&quot;" 
     providerName="System.Data.EntityClient" />

It works on my machine but not on the clients machine.

Client gets this error

Could not resolve host '(LocalDB)' 

Client is using MAC. Does he have to install anything else apart from VS 2017?

mohsinali1317
  • 4,255
  • 9
  • 46
  • 85
  • You could use localhost which would work for both – BugFinder Jan 10 '18 at 12:23
  • Can you explain a bit please? – mohsinali1317 Jan 10 '18 at 12:24
  • 1
    dont use "(LocalDB)" use "localhost" its the name of yourself, what is unclear? – BugFinder Jan 10 '18 at 12:26
  • So you are saying I create my database using localhost and then update the connection string? Do we have a tutorial for that? – mohsinali1317 Jan 10 '18 at 12:33
  • [check this](https://stackoverflow.com/a/39487777/1132334) on the machine where it fails. – Cee McSharpface Jan 10 '18 at 12:37
  • No, localhost is just the name its like my name is Bugfinder, I might talk of "I" if Im talking of me, or me.. localhost is an auto name there, you dont need to create anything, the (LocalDB)\xxx is the "machine name\instance" format, so localhost\instance works for local.. of course it needs sql installed on it though .. the client has that too? – BugFinder Jan 10 '18 at 12:47
  • Can I host the database free somewhere for now? and then when its good I can probably change it to paid solution – mohsinali1317 Jan 10 '18 at 12:56

1 Answers1

0

It works on my machine but not on the clients machine.

LocalDB is a development DB. If you release or install your software, you will need a better solution.

If you insist on using local db for productive use, you will need to install it where you want to use it. Information on how to install it can be found here.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
  • The client is using MAC and apparently there is no option of localDB on MAC. So can I use localhost as mentioned above by someone. – mohsinali1317 Jan 10 '18 at 12:46