开发者

Windows Service The underlying provider failed on Open Problem

I Developed Windows Service with EF4.0.

There is a some standart code in my code that is run in console application.

private void ServiceTimer_Tick(object sender, System.Timers.ElapsedEventArgs e)
{

  this.tim开发者_如何学Pythoner.Stop();

  try
  {

    using (PHEntities pe = new PHEntities ())
    {           
      var result = (from c in pe.tblCustomer
                    from j in c.tblJPConfig
                    select new { c.ID, c.ExpireTime, j.printed}

                             );
      foreach (var item in result)
      {
         .....
      }
   }

   this.timer.Start();

}  
catch (Exception ex) 
{
  eventLog1.WriteEntry(ex.Message, EventLogEntryType.Error);              
}

After this code run, Event viewer write "The underlying provider failed on Open Problem" Error.

Please Help.


That means that it is having trouble connecting to your database. Check your connection string and passwords. Check that the database accepts incoming connections. Try connecting manually (using SQL Server Management Studio if it is an MS SQL Server)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜