c# - Erorr when connecting to database -


My WCF method tries to get some data from the database that finally calls this method:

  Public override IQueryable & lt; Apartment & gt; GetAll () {return base.GetAll () Include ("Pictures"). Include ("Infos"); } Public Virtual IQueryable & lt; T & gt; GetAll () {Return DbSet; }   

But it seems that when it tries to open the connection to the database, it happens. I'm getting the error The underlying provider failed on the open. "I can somehow specify the WCF confg file in which the database is allowed to connect or WCF is allowed to connect to my database in my project. Some other solutions?

  public base () {DataContext = new context (); this.DbSet = DataContext.Set  (); datacontext.config.procisioning enabled = valid; datacontex.configment public category Reference: Public Reference (): B ("Default connection") {}   

...

 

/ code>

context in that override.

  reference to public partial category { Public Context (String Target DCBConnection): Base (constructor to pass in a separate connection string (which should also be in the form of that name): Base TargetDBConnection) {}}    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -