.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Connection problem when connecting from windows service in Windows 7 embedded

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Hi everyone

I'm trying to migrate our applications working with SQL Server 2005 Express from Windows XP to Windows 7, and have following problem. Desktop applications connect to SQL Server fine, but windows service app returns following error when trying to connect: [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error

I tried installing service under localsystem account and under desktop user account with no success.

My connection string looks like Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user;Initial Catalog=data;Data Source=servername

I've searched a bit about this error and one recommendation was to try to use SQL Native client, so I tried to change my connection string to

Provider=SQLNCLI;Pwd=password;UID=user;Database=data;Server=servername, this also works when running from desktop but when running from windows service I get another error

SQL Network Interfaces: The requested security package does not exist

This seems to be purely client problem because when I use wrong server name I still get the same errors.

I guess something changed with permissions of services in Windows 7

Any ideas what could be wrong and how to fix it?

View Complete Post

More Related Resource Links

Problem consuming 32bit WCF service which references a native Dll in a 64 bit OS(Windows Server 2008

I have some 32bit Dlls which i want to use it in 64bit OS as i do not have a source code of this to recompile it for 64 bit OS. I have created a x86(32 Bit) WCF service which calls these Dlls and hosted it as a Windows Service on a x64(64 Bit) machine using Windows Server 2008. I have created one more x64 client which calls a function in the WCF which in turn calls a function from the 32 bit native Dll. Whenever i try calling this WCF from the client I get an error as given below.Can anybody please guide as to where I am going wrong and what is needed to solve this issue. Thanks in advance for any help.******The Error Message********************System.BadImageFormatException: Could not load file or assembly 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.File name: 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null'   at TestWrapperWCFClient.Form2.button1_Click(Object sender, EventArgs e)   at System.Windows.Forms.Control.OnClick(EventArgs e)   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)   at System.Windows.Forms.Control.WndProc(Message& m)   at System.Windows.Forms

Windows service problem


I just wrote a sample windows service application with the code provided at : http://msdn.microsoft.com/en-us/library/zt39148a(VS.80).aspx

I built it and installed it. When I tried to run it from the service, it gives me the following error:

The portalreportscanner service on local computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.

When I check the error in event viewer I see the following:

Event Type: Error
Event Source: PortalReportScanner
Event Category: None
Event ID: 0
Date:  2010-09-21
Time:  12:46:35 PM
User:  N/A
Computer: W3560
Service cannot be started. System.ArgumentException: The source 'PortalReportScanner' is not registered in log 'PortalReportScannerLog'. (It is registered in log 'Application'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property.
   at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName)
   at System.Diagnostics.EventLog.WriteEntry(String message, Event

problem with connecting to local SQL Server 2008 default instance using windows authentication




I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.


2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT:]



This us

Connection Pooling VS Steady Connection in Windows Service Application


Hi All,

We are developing a windows service application which queries the sql db every second. For now, we have enabled connection pooling and every time we open and close connection at every access. Since it is a windows service can I open connection at service startup and close the connection shutdown

Please let me know the right approach in this scenario.





Windows xp service pack 3 is required problem


 hi for all

i have problem with instal visual studio 2010

when i instal the visual studio on my computer

it geve me error message Windows xp service pack 3 is required

this is my problem i try with download windows updates

but without result any one can help me

Connection times out when WCF client tries to call WCF service, both in Windows Forms apps



The exception message is: Could not connect to TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

What I am trying to do: a WCF service is self hosted in a Windows Forms application. The WCF client is in another Windows Forms application. Eventually, the client is supposed to run on a computer somewhere out there on the Internet and send messages to the server which is running on my home computer. This is my first attempt at making a remote WCF call.

I have success when server and client either run on the same computer, or are running on different computers attached to my little in-home LAN. When I try to route the client's request via Internet (in preparation for having the client reside out there somewhere) I get the exception reproduced in the first paragraph above after waiting for about 20 seconds.

OS is WinXP Pro with SP3. Using Visual Studio 2008, Visual Basic. is the IP currently assigned to me by Comcast (I watch carefully to see when it changes; also, I altered it for purposes of asking this question).


Word Automation through Windows service (Windows Server 2008) - Problem

I went through the thread in this link http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/65a355ce-49c1-47f1-8c12-d9cf5f23c53e (which is a very similar problem to mine), but couldnt solve my problem.
I seem to face a very related problem in word automation.
I have created a windows service which creates a sample word document (WORD 2007) and then converts it to a .doc file (WORD 2003 format) or a PDF file , based on requirement.  Let me post the sample code here :

Problem installing Windows installer 4.5 on vista service pack 1

I am trying to install SQL server on Windows Vista. When installing it asks to update windows installer. When I was trying to install windows installer 4.5 (x86 Platform: Windows6.0-KB942288-v2-x86.msu ) I am getting an error saying "the update does not apply on your system". How do i install windows installer 4.5 on my OS.

Problem installing Windows installer 4.5 on vista service pack 1

I am trying to install SQL server on Windows Vista. When installing it asks to update windows installer. When I was trying to install windows installer 4.5 (x86 Platform: Windows6.0-KB942288-v2-x86.msu ) I am getting an error saying "the update does not apply on your system". How do i install windows installer 4.5 on my OS.

Problem connecting using ODBC from Windows Server 2008R2 x64




I have strange problem: when I'm trying to create new “System DSN” (ODBC Data Source Administrator) using either SQL Native Client or “integrated” SQL Serve source I’m getting next:

Connection failed:

SQLState: '08001'

SQL Server Error: 1326

[Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [1326].

Connection failed:

SQLState: 'HYT00'

SQL Server Error: 0

[Microsoft][SQL Server Native Client 10.0]Login timeout expired

what strange for me – is that I can create this Data Source either on the other machine (Windows XP there) or on the server host (Server 2008 x64)…

Windows Firewall turned off on that host and I have no idea what to check next…

Any help appreciated.


Best regards...

How to establish a connection between a web service and windows service

I must establish a connection between a web service and windows service. And i need some sort of listener between these two components when the connection is done both componenets must be informed. such as Web services will send an error message to the end user and the service windows will do a rollback of the operation he was doing.

What is the best way to implement this scenario.

Please help me with a speedy reply

Thanks in advance

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Test Run: Test automation with Windows XP Embedded


This month's column explores how to create lightweight but powerful UI test automation for software systems that run on Windows XP Embedded.

Dr. James McCaffrey and Mike Hall

MSDN Magazine October 2007

Mobilize: Explore The New Features In Windows Embedded CE 6.0


Paul Yao presents an overview of Windows Embedded CE 6.0.

Paul Yao

MSDN Magazine December 2006

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Service Station: Serialization in Windows Communication Foundation


Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006

Windows Services: New Base Classes in .NET Make Writing a Windows Service Easy


Windows services are applications that run outside of any particular user context in Windows NT, Windows 2000, or Windows XP. The creation of services used to require expert coding skills and generally required C or C++. Visual Studio .NET now makes it easy for you to create a Windows service, whether you're writing code in C++, C#, or Visual Basic. You can also write a Windows service in any other language that targets the common language runtime. This article walks you through the creation of a useful Windows service, then demonstrates how to install, test, and debug the service.

Ken Getz

MSDN Magazine December 2001

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend