I have a WCF web service running on top of Entity Framework with Sql Compact 4.0 and it runs fine on DiscountASP. I have added some web pages (.aspx) to the solution, running in a different application project. These web pages need access to the database for the web service, in its project. Now, the connection string for the Sql .sdf file in the web service uses the standard “Data Source = |DataDirectory|\Mydb.sdf” syntax. But, now I need the connection string for the web page project, and its |DataDirectory| in its web.config connection string will refer to its own project's App_Data folder. How can I point the web page project's connection string to the database in the web service project? On my local dev box, I would just use the absolute path, but I don't know how to do that on your hosting service. Thanks.
An absolute path to your web space can be found through the DiscountASP.NET Control Panel under Account Info/Edit: https://my.discountasp.net/account-info.aspx
Hello I new here anyway....... The problem is, that suddenly when browsing the website, that connects to the DATABASE through the providers I get this ERROR: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) My connection string looks like this below: <connectionStrings> <add name="TzSearchEntities" connectionString="metadata=.\Northwind.csdl|.\Northwind.ssdl|.\Northwind.msl;provider=System.Data.SqlClient; provider connection string="Data Source= esql2k802.discountasp.net;Initial Catalog=SQL2008_898285_me;User ID=SQL2008_898285_me_user;Password=luanda123;" providerName="System.Data.EntityClient" /> </connectionStrings> I don't know if Imiss some thing could anyone help me please..
This is my code in the web.config <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> <add name="TzSearchEntities" connectionString="metadata=res://*/Models.DataModel.csdl|res://*/Models.DataModel.ssdl|res://*/Models.DataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\TzSearch.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/> </connectionStrings>
SQL Express is not supported. You need to change the connection string to point to your database here at DiscountASP.NET.