I tried to connect the database on my local machine. API throws exception "The underlying provider failed on Open". I checked the inner exception to find out more my fault.
The solution key is in your Web.config file. I use this configuration and it works.
<connectionStrings>
<add name="MyDBEntities" connectionString="metadata=res://*/DBAAA.csdl|res://*/DBAAA.ssdl|res://*/DBAAA.msl;provider=System.Data.SqlClient;
provider connection string="
data source=MyMachineDomainHQGWD2S\SQLEXPRESS;
initial catalog=My_DB_TEST;
integrated security=True;
MultipleActiveResultSets=True;
App=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>
Hope it can help :D
======================================================================
UPDATE
======================================================================
I've got the problem again! I want to add the strongly note that YOU CANNOT SET data source AS YOU LOCAL IP!! PLEASE SET IT TO $DOMAIN\$MACHINE_NAME
Then you can access the database with locahost:port/service or _your_ip:port/service
======================================================================

ไม่มีความคิดเห็น:
แสดงความคิดเห็น